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.5 (2026/09/04)

Reference
Table of Contents  ▸  List of Commands  ▸  Reptorian's Commands  ▸  rep_mode_blend◀  rep_mode    |    rep_val2order  ▶

rep_mode_blend

Arguments:

  • _tie_breaker={ 0=NaN | 1=Average }

Description:

Blend layers using the statistical mode of pixel colors.

 
_tie_breaker determines how to resolve pixels where two or more colors
share the highest frequency (i.e. there is no single mode).
  0 = output NaN for tied pixels
  1 = output the average of the tied colors
Author: Reptorian.

Default values:

_tie_breaker=0

Example of use:

testimage2d 200,200 .x4 foreach { 75,75,1,3,[{expr('v(255)',3)}] j.. .,$%~,$%~ rm. } +rep_mode_blend

Command: testimage2d 200,200 .x4 foreach { 75,75,1,3,[{expr('v(255)',3)}] j.. .,$%~,$%~ rm. } +rep_mode_blend
Command: testimage2d 200,200 .x4 foreach { 75,75,1,3,[{expr('v(255)',3)}] j.. .,$%~,$%~ rm. } +rep_mode_blend
Command: testimage2d 200,200 .x4 foreach { 75,75,1,3,[{expr('v(255)',3)}] j.. .,$%~,$%~ rm. } +rep_mode_blend
Command: testimage2d 200,200 .x4 foreach { 75,75,1,3,[{expr('v(255)',3)}] j.. .,$%~,$%~ rm. } +rep_mode_blend
Command: testimage2d 200,200 .x4 foreach { 75,75,1,3,[{expr('v(255)',3)}] j.. .,$%~,$%~ rm. } +rep_mode_blend
Command: testimage2d 200,200 .x4 foreach { 75,75,1,3,[{expr('v(255)',3)}] j.. .,$%~,$%~ rm. } +rep_mode_blend
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.