module CrImage::Operation::ChannelSwap

Overview

Swaps channels of ChannelType supported by an image

Taking sample image:

Woman with black turtleneck and white background
image.channel_swap(:green, :red) # Crystal autocasting of symbols to Pluto::ChannelType enum is magic
Channel swapped image swapping the green and red channels

Direct including types

Defined in:

cr-image/operation/channel_swap.cr

Instance Method Summary

Instance Method Detail

def channel_swap(a : ChannelType, b : ChannelType) : self #

[View source]
def channel_swap!(a : ChannelType, b : ChannelType) : self #

[View source]