Repository navigation
Reduce noise by luminance and color strength, before demosaicing for RAW photos #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
6778b3b
09701ec
b9ca348
94a4b64
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,8 @@ import { setGrain } from "@/features/grain/edits"; | |
| import { grainSchema } from "@/features/grain/model"; | ||
| import { addLayer, deleteLayer } from "@/features/layers/edits"; | ||
| import { maskSchema } from "@/features/layers/model"; | ||
| import { setNoiseReduction } from "@/features/noise-reduction/edits"; | ||
| import { noiseReductionSchema } from "@/features/noise-reduction/model"; | ||
| import { curveSchema, defaultCurve } from "@/features/tone-curves/curve"; | ||
| import { setToneCurve } from "@/features/tone-curves/edits"; | ||
| import { setVignette } from "@/features/vignette/edits"; | ||
|
|
@@ -65,6 +67,7 @@ function reset(document: EditorDocument) { | |
| adjustments: { ...defaultAdjustments }, | ||
| toneCurve: defaultCurve, | ||
| whiteBalance: source.raw?.asShot, | ||
| noiseReduction: undefined, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Update the
Proposed fix reset: command(
- "Removes every layer and returns the photo's adjustments, tone curve, white balance, crop, and perspective to how it opened, as one edit.",
+ "Removes every layer and returns the photo's adjustments, tone curve, white balance, noise reduction, crop, and perspective to how it opened, as one edit.",
none,
reset,
),🤖 Prompt for AI Agents |
||
| }, | ||
| ], | ||
| }); | ||
|
|
@@ -104,6 +107,14 @@ export const commands = { | |
| return { layerId: image(document).id }; | ||
| }, | ||
| ), | ||
| "set-noise-reduction": command( | ||
| "Reduces the photo's noise before its adjustments, a RAW photo's before demosaicing: luminance and color from 0, none, to 100, keeping omitted values. 50 removes the noise the photo measures; more smooths further. The first reduction of a photo takes a moment; later strengths apply at once. RAW files without a 2 × 2 mosaic, such as Fujifilm X-Trans, have none.", | ||
| change(noiseReductionSchema), | ||
| (document, change) => { | ||
| setNoiseReduction(document, change); | ||
| return { layerId: image(document).id }; | ||
| }, | ||
| ), | ||
| "set-color-mixer": command( | ||
| "Shifts one color range's hue, saturation, or luminance from -100 to 100, keeping other colors and omitted values. Neutral grays are unaffected. Without layerId it edits the first Color Mixer layer, creating one when there is none.", | ||
| z.extend(mixerChange, { color: mixerColor, layerId }), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Limit this claim to supported image sources.
Line 98 says noise reduction applies to “any other image,” but the PR objectives exclude X-Trans and linear DNG files. Limit this clause to supported encoded-color sources so the architecture guide does not promise noise reduction for excluded formats.
As per coding guidelines, “Keep this file true.”
Suggested wording
🧰 Tools
🪛 LanguageTool
[style] ~98-~98: This sentence contains multiple usages of the word “again”. Consider removing or replacing it.
Context: ...te balance does, without reducing noise again; a newer request need not wait for a fi...
(REPETITION_OF_AGAIN)
🤖 Prompt for AI Agents
Source: Coding guidelines