Control Adobe Lightroom CC using HTTP requests by using the Lightroom External Controller API.
💡 This project is not affiliated with Adobe Systems Incorporated in any way. It is an independent tool that utilizes the Lightroom External Controller API to provide a simple interface for controlling Lightroom CC.
lightroom-controller
is a simple CLI that acts as a bridge between external tools and Adobe Lightroom CC. It allows you to control Lightroom's sliders and settings using simple HTTP requests, making it compatible with various tools like Karabiner-Elements, Automator, or custom scripts.
The tool listens for incoming HTTP requests and translates them into actions within Lightroom. This happens through the Lightroom External Controller API, which must be enabled in Lightroom CC.
Using the External Controller API without lightroom-controller
would require a more complex setup, as it involves handling WebSocket connections and parsing the API's JSON responses, making it hard to combine with other tools.
Launch Adobe Lightroom CC on your computer.
Enable the External Controller API in Lightroom CC by going to Preferences > Interface
and checking the box for "Enable external controllers".
Start the controller by running the following command in your terminal:
npx lightroom-controller
You should now see a Lightroom dialog asking you to allow the connection from the external controller. Click "Pair" to grant access.
You can now send HTTP requests to control Lightroom. For example, to increment the exposure:
curl http://localhost:3000/Exposure2012/increment
To increment the exposure by a specific amount:
curl http://localhost:3000/Exposure2012/increment?amount=0.5
To reduce the contrast:
curl http://localhost:3000/Contrast2012/decrement
To advance to the next photo:
curl http://localhost:3000/null/nextPhoto
GET /{parameter}/{action}
GET /{parameter}/{action}?amount={value}
Adjustable parameters for controlling Lightroom. The names are based on the weird names used by the Lightroom External Controller API, which are not very intuitive tbh. Not all parameters are tested, but most of them should work as expected. The parameter name is passed to Lightroom no matter if known or unknown.
AutoGrayscaleMix
, AutoLateralCA
, Blacks2012
, BlueHue
, BlueSaturation
, CameraProfile
, Clarity2012
, ColorGradeBlending
, ColorNoiseReduction
, ColorNoiseReductionDetail
, ColorNoiseReductionSmoothness
, Contrast2012
, CorrectionAmount
, CurveRefineSaturation
, DefringeGreenAmount
, DefringePurpleAmount
, Dehaze
, DepthCorrectionAmount
, DepthSource
, EnhanceDenoise
, EnhanceDenoiseAmount
, EnhanceRawDetails
, EnhanceSuperResolution
, Exposure2012
, GrainAmount
, GrainFrequency
, GrainSize
, GrayMixerAqua
, GrayMixerBlue
, GrayMixerGreen
, GrayMixerMagenta
, GrayMixerOrange
, GrayMixerPurple
, GrayMixerRed
, GrayMixerYellow
, GreenHue
, GreenSaturation
, HDREditMode
, HDRMaxValue
, Highlights2012
, HueAdjustmentAqua
, HueAdjustmentBlue
, HueAdjustmentGreen
, HueAdjustmentMagenta
, HueAdjustmentOrange
, HueAdjustmentPurple
, HueAdjustmentRed
, HueAdjustmentYellow
, LensBlur.Active
, LensBlur.BlurAmount
, LensBlur.CatEyeAmount
, LensBlur.HighlightsBoost
, LensBlur.ShowOverlay
, LensProfileDistortionScale
, LensProfileEnable
, LensProfileVignettingScale
, LocalBlacks2012
, LocalClarity2012
, LocalContrast2012
, LocalCurveRefineSaturation
, LocalDefringe
, LocalDehaze
, LocalExposure2012
, LocalGrain
, LocalHighlights2012
, LocalLuminanceNoise
, LocalMoire
, LocalSaturation
, LocalShadows2012
, LocalSharpness
, LocalTemperature
, LocalTexture
, LocalTint
, LocalWhites2012
, Look.Amount
, LuminanceAdjustmentAqua
, LuminanceAdjustmentBlue
, LuminanceAdjustmentGreen
, LuminanceAdjustmentMagenta
, LuminanceAdjustmentOrange
, LuminanceAdjustmentPurple
, LuminanceAdjustmentRed
, LuminanceAdjustmentYellow
, LuminanceNoiseReductionContrast
, LuminanceNoiseReductionDetail
, LuminanceSmoothing
, OverrideLookVignette
, PerspectiveUpright
, PointColorHueShift
, PointColorLumScale
, PointColorRangeAmount
, PointColorSatScale
, PointColorVisualizeRange
, PostCropVignetteAmount
, PostCropVignetteFeather
, PostCropVignetteHighlightContrast
, PostCropVignetteMidpoint
, PostCropVignetteRoundness
, RedHue
, RedSaturation
, SDRBlend
, SDRBrightness
, SDRClarity
, SDRContrast
, SDRHighlights
, SDRShadows
, SDRWhites
, Saturation
, SaturationAdjustmentAqua
, SaturationAdjustmentBlue
, SaturationAdjustmentGreen
, SaturationAdjustmentMagenta
, SaturationAdjustmentOrange
, SaturationAdjustmentPurple
, SaturationAdjustmentRed
, SaturationAdjustmentYellow
, ShadowTint
, Shadows2012
, SharpenDetail
, SharpenEdgeMasking
, SharpenRadius
, Sharpness
, SplitToningBalance
, Temperature
, Texture
, Tint
, Vibrance
, WhiteBalance
, Whites2012
, cropBottom
, cropLeft
, cropRight
, cropTop
, previewForSDRDisplay
, straightenAngle
, visualizeHDRRanges
Available actions for each parameter. The name of the action is passed to Lightroom no matter if known or unknown.
increment
: Increases the value of the parameter by a small amount.decrement
: Decreases the value of the parameter by a small amount.
For navigation and utility actions, use a null
parameter with specific action names:
copyEditSettings
, editInPhotoshop
, exportWithPrevious
, flagDecrease
, flagIncrease
, nextPhoto
, openExport
, pasteEditSettings
, previousPhoto
, ratingDecrease
, ratingIncrease
, resetAllDevelopAdjustments
, rotateLeft
, rotateRight
, showCopyEditSettings
, zoomInSome
, zoomOutSome
, zoomToFill
, zoomToFit
, zoomToOneToOne
, toggleZoom
curl http://localhost:3000/null/nextPhoto
curl http://localhost:3000/null/zoomToFit
curl http://localhost:3000/null/resetAllDevelopAdjustments
For increment
and decrement
actions, you can optionally specify an amount
parameter to control the adjustment value:
amount
(optional): A numeric value to specify the increment/decrement amount. If omitted, Lightroom uses its default increment value.
lightroom-controller
can be configured using environment variables.
The port to run the server on. Defaults to 3000
.
PORT=3000 npx lightroom-controller
The WebSocket URL of your Lightroom instance. Defaults to ws://127.0.0.1:7682
.
If the port is not available, Lightroom falls back to a different port. The port that it uses will be saved into a connections.json
file by Lightroom.
Mac: ~/Library/Application Support/Adobe/Lightroom CC/Connections
Windows: AppData\Local\Adobe\Lightroom CC\Connections
LIGHTROOM_WS_URL=ws://127.0.0.1:7682 npx lightroom-controller
You can use lightroom-controller
with Karabiner-Elements to control Lightroom using keyboard shortcuts. Here's an example configuration that maps the F1
key to increase the exposure and the F2
key to decrease it:
{
"title": "Lightroom Controller",
"rules": [
{
"description": "Control Lightroom Exposure",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "f1"
},
"to": [
{
"shell_command": "curl http://localhost:3000/Exposure2012/increment"
}
]
},
{
"type": "basic",
"from": {
"key_code": "f2"
},
"to": [
{
"shell_command": "curl http://localhost:3000/Exposure2012/decrement"
}
]
}
]
}
]
}
lightroom-controller
will also work with AutoHotkey to control Lightroom using keyboard shortcuts. Here's an example with similar actionality to the prior example:
#Requires AutoHotkey v2.0
DEBUG_TOOLTIPS := true ; show the request being sent in a minimal popup
TOOLTIP_TIME := 2000 ; amount of time in ms that the popup will linger
SendHTTPRequest(url) {
try {
http := ComObject("WinHttp.WinHttpRequest.5.1")
http.Open("GET", url, false)
http.Send()
if DEBUG_TOOLTIPS{
ToolTip("API: " . url . " | Status: " . http.Status, 10, 10)
SetTimer(() => ToolTip(), -TOOLTIP_TIME)
}
} catch Error as e {
ToolTip("HTTP Error: " . e.Message, 10, 10)
SetTimer(() => ToolTip(), -TOOLTIP_TIME)
}
}
; Map F1 to increment exposure
F1::SendHTTPRequest("http://localhost:3000/Exposure2012/increment")
; Map F2 to decrement exposure
F2::SendHTTPRequest("http://localhost:3000/Exposure2012/decrement")
increment
anddecrement
do not work on crop parameters (cropTop
,cropLeft
,cropBottom
,cropRight
). This appears to be a limitation of Adobe's current controller API