Last active
August 29, 2015 14:14
-
-
Save oscardelama/9f1a52e7017666011be6 to your computer and use it in GitHub Desktop.
rgb-noise: Scale function from linear sRGB to Lightroom sRGB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the LR tifs var data | |
tif.var.zero <- vvm.tif$var.df | |
# Rename 'mean' and 'var' columns to avoid later name colision in merging | |
names(tif.var.zero)[3:4] <- paste0('tif.', names(tif.var.zero)[3:4]) | |
# Remove sample file name extension to make possible the merge by picture file name | |
tif.var.zero$pict <- substr(tif.var.zero$pict, 1, 8) | |
# Compute the linear sRGB values | |
vvm.rgb.lin <- convert.to.rgb(target.space = 'sRGB', use.camera.tc = FALSE, target.tc = 'linear') | |
# Get the sRGB linear wide var data | |
lin.rgb.var <- vvm.rgb.lin$var.df | |
# Remove sample file name extension to make possible the merge by picture file name | |
lin.rgb.var$pict <- substr(lin.rgb.var$pict, 1, 8) | |
# Merge linear sRGB and LR tiff var data for each sample | |
lin.rgb.and.tif <- merge(lin.rgb.var, tif.var.zero, c('pict', 'channel')) | |
# Plot LR values as function of our sRGB linear values | |
ggplot(lin.rgb.and.tif, aes(x = mean/255, y = tif.mean/255, | |
group = channel, colour = channel)) + | |
ggtitle('Scale Applied to Linear sRGB\nBy Lightroom') + | |
xlab('Linear sRGB') + ylab('Lightroom sRGB') + | |
scale_x_continuous(breaks = seq(0, 1, 0.25), | |
labels=c('0%', '25%', '50%', '75%', '100%')) + | |
scale_y_continuous(breaks = seq(0, 1, 0.25), | |
labels=c('0%', '25%', '50%', '75%', '100%')) + | |
geom_point(size = 1.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment