G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing
Banner Institutions GREYC CNRS ENSICAEN UNICAEN

A Full-Featured Open-Source Framework for Image Processing



Latest stable version: 4.0.4 (2026/08/19)

Reference
Table of Contents  ▸  List of Commands  ▸  Reptorian's Commands  ▸  rep_lavander_binary_map◀  rep_red_acrylic_filter    |    rep_vibrance_ych  ▶

rep_lavander_binary_map

Arguments:

  • _size_of_arr_by_power_of_two>0,_mode={ -3=xor | -2=or | -1=and | "-"=custom | 0=and | 1=or | 2=xor },_bin_a,_bin_b,_shift>0,custom_expression

Description:

Create a texture that does the following steps:

1) Create an array of integer that matches index with size of 2^n.
2) Create another array which is the count of bin_a in binary representation of the previous array.
3) Count sort the array of integer with the count of binary number array.
4) Delete all other array other than the sorted array.
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.
Built-in Macros -
flip(v) - Flips the bitwise values of number
and(a,b) - a & b
or(a,b) - a | b
End of Built-in Macros -
Note : The idea comes from Lavander at discord/generative. Based on a Python code.

Default values:

_size_of_arr_by_power_of_two=11,_mode=2,_bin_a=01,_bin_b,_shift=0,

G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing

G'MIC is an open-source software distributed under the CeCILL free software licenses (LGPL-like and/or
GPL-compatible). Copyrights (C) Since July 2008, David Tschumperlé - GREYC UMR CNRS 6072, Image Team.