惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
爱范儿
爱范儿
GbyAI
GbyAI
博客园 - 叶小钗
Last Week in AI
Last Week in AI
Jina AI
Jina AI
Microsoft Security Blog
Microsoft Security Blog
云风的 BLOG
云风的 BLOG
C
Check Point Blog
H
Help Net Security
P
Proofpoint News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
大猫的无限游戏
大猫的无限游戏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog RSS Feed
Y
Y Combinator Blog
U
Unit 42
T
Tailwind CSS Blog
MyScale Blog
MyScale Blog
N
Netflix TechBlog - Medium
S
SegmentFault 最新的问题
J
Java Code Geeks
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

Posts on Noah Bailey

How to turn anything into a router Deploy to Cloudfront from GitHub using OpenID Connect Backup Postgres databases with Kubernetes CronJobs The spelling error made 200 billion times a day Restarting Kubernetes pods using a CronJob You've just bought a new domain. Now what? Who Sawed My Motherboard??? Linux on the P8 Aliexpress Mini Laptop Recovering Mysql/Mariadb after a nasty crash Using EXIF data to pick my next lens Thank you, 2016 iPhone Don't Make It Work Self-hosted Surveillance with ZoneMinder Backups, Monitoring, and Security for small Mastodon servers Block web scanners with ipset & iptables Executing commands over SSH with GitHub Actions Debian Sid on encrypted ZFS Protect your dangerously insecure redis server Debian: the luxurious boring lifestyle Monitor radiation with a Raspberry Pi Simple Linux server alerts: Know your performance, errors, security, syslog, and security NUC crashes on debian 11 - How I fixed it Basic Linux server security with fail2ban, ossec, and firewall Windows 11 will create heaps of needless trash Domesticated Kubernetes Networking The Cursed Certificate Our mostly disposable and entirely stupid world Trying out OpenBSD (as a Linux geek) Making VoIP Calls with Antique Rotary Phones Monitoring WAN speed with speedtest-cli and ElasticSearch
Converting and developing RAW photos on Linux automatically
2023-10-29 · via Posts on Noah Bailey

Taking photos is fun and easy.

Just kidding, it’s a fractal of complexity, FOMO, and slowly realizing how little you actually know.

However, one nice thing is that using some simple Unix/Linux tools, it’s remarkably easy to mass produce good looking JPEG images from your raw photos, without having to actually learn Lightroom.

After a few days of fiddling with the settings, I’ve come up with this bash script to process my images:

/usr/local/bin/autoraw

When run, it handles all the conversion itself:

% autoraw P1190515.RW2

Loading Panasonic DMC-GX85 image from P1190515.RW2 ...
Wavelet denoising...
Scaling with darkness 143, saturation 4095, and
multipliers 1.000000 0.435374 0.702381 0.435374
AHD interpolation...
Blending highlights...
Converting to sRGB colorspace...
Writing data to standard output ...
-=>P1190515.raw.jpg TIFF 3464x4608 3464x4608+0+0 8-bit sRGB 6.10639MiB 0.270u 0:00.270
    1 image files updated

How does it work? Good question!

The first part of the tool uses dcraw to process the raw image with sane default settings:

dcraw -w -c -v -n 200 -b ${2:-1} -H 0 -T "$DIR/$FILE.$FMT"

This uses the white balance from the camera, sets the exposure, rolls off the whites, and performs a very gentle denoise.

The second line is where the real magick happens:

convert - -verbose \
  -modulate '100,125' \
  -contrast-stretch '0.3x0%' \
  -level '0%,100%,1.2' \
  -sigmoidal-contrast '2.50,50%' \
  -adaptive-sharpen '0x4.0' \
  -quality '90' -auto-orient \
  $DIR/$FILE.jpg

This imagemagick command is rather complicated, but does some important work. First, the saturation is increased by 25%. Then, by using the contrast-stretch function, the black & white points are set, then the darker midtones are turned up slightly, then a sigmoid contrast curve is applied to add a pleasing gamma shift to the image. Finally, the image is sharpened and output as a high quality JPEG image.

The final part of the script simply copies the EXIF data from the original photo to the JPEG image, preserving the timestamp, camera settings, and any other metadata that may be desirable to maintain.

The end result is pleasing, and without much effort dozens of images can be processed this way.