You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: IMGADJ/IMGADJ.BI
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -56,10 +56,12 @@ DECLARE SUB GJ_IMGADJ_HSVtoRGB (hue AS SINGLE, sat AS SINGLE, value AS SINGLE, r
56
56
DECLARE FUNCTION GJ_IMGADJ_CreateTestImage AS LONG
57
57
DECLARE FUNCTION GJ_IMGADJ_CreateComplexTestImage AS LONG
58
58
DECLARE FUNCTION GJ_IMGADJ_CreateGradientTestImage AS LONG
59
+
DECLARE FUNCTION GJ_IMGADJ_CreateTestImageWithBlack AS LONG
59
60
DECLARE FUNCTION GJ_IMGADJ_LoadTestImage (imageType AS STRING) AS LONG
60
61
DECLARE SUB GJ_IMGADJ_ShowComparison (originalImg AS LONG, adjustedImg AS LONG, title AS STRING)
61
62
DECLARE FUNCTION GJ_IMGADJ_Brightness (sourceImg AS LONG, direction AS STRING, amount AS INTEGER) AS LONG
62
63
DECLARE FUNCTION GJ_IMGADJ_Contrast (sourceImg AS LONG, direction AS STRING, amount AS INTEGER) AS LONG
64
+
DECLARE FUNCTION GJ_IMGADJ_BrightnessContrastNonBlack (sourceImg AS LONG, brightnessDir AS STRING, brightnessAmount AS INTEGER, contrastDir AS STRING, contrastAmount AS INTEGER) AS LONG
63
65
DECLARE FUNCTION GJ_IMGADJ_Gamma (sourceImg AS LONG, direction AS STRING, amount AS INTEGER) AS LONG
64
66
DECLARE FUNCTION GJ_IMGADJ_Saturation (sourceImg AS LONG, direction AS STRING, amount AS INTEGER) AS LONG
65
67
DECLARE FUNCTION GJ_IMGADJ_Hue (sourceImg AS LONG, direction AS STRING, amount AS INTEGER) AS LONG
' ' Increases brightness by 30 and contrast by 20% for all non-black pixels
290
+
'
291
+
FUNCTION GJ_IMGADJ_BrightnessContrastNonBlack (sourceImg AS LONG, brightnessDir AS STRING, brightnessAmount AS INTEGER, contrastDir AS STRING, contrastAmount AS INTEGER)
Copy file name to clipboardExpand all lines: IMGADJ/README.md
+50Lines changed: 50 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,16 +14,34 @@ Image adjustment is a common need in graphics programming, but implementing effi
14
14
-**Memory safety** - clear ownership of returned image handles
15
15
-**Performance** - 10-200x faster than naive implementations
16
16
-**Real-time capability** - suitable for interactive applications
17
+
-**Selective processing** - NEW! Non-black adjustments preserve pure black pixels
17
18
18
19
The library draws inspiration from professional image editing software like Photoshop and GIMP, providing similar adjustment capabilities in a QB64PE-friendly format.
19
20
21
+
### **NEW!** Selective Black Preservation
22
+
23
+
The `GJ_IMGADJ_BrightnessContrastNonBlack&()` function addresses a common problem in image processing: maintaining pure black elements while adjusting the rest of the image.
24
+
25
+
**Problem Solved:**
26
+
- Traditional brightness adjustments turn black (RGB 0,0,0) pixels gray
27
+
- Black text, outlines, borders, and UI elements lose their crispness
28
+
- Logos and graphics with black elements become muddy
29
+
30
+
**Solution Benefits:**
31
+
-**Preserves text readability** - Black text stays perfectly black
32
+
-**Maintains UI crispness** - Black borders and outlines remain sharp
33
+
-**Artistic control** - Keep pure black shadows and artistic elements
34
+
-**Logo processing** - Enhance colored portions without affecting black elements
35
+
-**Efficient processing** - Single function combines brightness + contrast with pixel selection
0 commit comments