Skip to content

Applying a simple luminance to RGB LUT #3793

Answered by jcupitt
taylorthurlow asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @taylorthurlow,

Yes, just use #maplut. Something like:

#!/usr/bin/ruby

require "vips"

# for each luminance value, the rgb triple we map it to
falsecolour_lut = [
	[ 12, 0, 25 ],
	[ 17, 0, 34 ],
	[ 20, 0, 41 ],
	[ 22, 0, 45 ],
	[ 23, 0, 47 ],
	[ 27, 0, 55 ],
	[ 12, 0, 25 ],
	[ 5, 0, 11 ],
	[ 5, 0, 11 ],
	[ 5, 0, 11 ],
	[ 1, 0, 4 ],
	[ 1, 0, 4 ],
	[ 6, 0, 13 ],
	[ 15, 0, 30 ],
	[ 19, 0, 40 ],
	[ 23, 0, 48 ],
	[ 28, 0, 57 ],
	[ 36, 0, 74 ],
	[ 42, 0, 84 ],
	[ 46, 0, 93 ],
	[ 51, 0, 102 ],
	[ 59, 0, 118 ],
	[ 65, 0, 130 ],
	[ 69, 0, 138 ],
	[ 72, 0, 146 ],
	[ 81, 0, 163 ],
	[ 47, 0, 95 ],
	[ 12, 0, 28 ],
	[ 64, 0, 144 ],
	[ 61, 0, 146 ],
	[ 55, 0, 140 ],
	[ 52, 0, 137 ],
	[ 47, 0, 132 ],
	[

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@taylorthurlow
Comment options

@taylorthurlow
Comment options

@jcupitt
Comment options

Answer selected by taylorthurlow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants