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
{{ message }}
Repository navigation
Commit 282c96b
Browse filesBrowse the repository at this point in the historyBrowse files
* ✅ **Studio Quality:** 32-bit floating-point precision (float32) to prevent color banding.
40
40
* ✅ **Advanced Memory Control:** Reuse GPU buffers across operations and resize without reallocation—critical for video processing and batch workflows.
41
+
* ✅ **OpenGL Integration:** Direct GPU-to-GPU display for real-time preview widgets.
41
42
* ✅ **API Simplicity:** Intuitive, Pythonic API designed for ease of use.
42
43
43
44
## Use Cases
44
45
45
46
***Generative Art:** Create thousands of unique variations in seconds.
46
47
***Motion Graphics:** Process video frames or generate effects in real-time.
47
48
***Image Compositing:** Complex multi-layer designs with GPU-accelerated effects.
Copy file name to clipboardExpand all lines: docs/io.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,6 +133,30 @@ How it works:
133
133
2. Downloads from GPU to CPU
134
134
3. Encodes and writes to disk
135
135
136
+
### Saving U8 Images Directly
137
+
138
+
When you've manually converted an image to uint8 for another purpose (e.g., OpenGL display, external library) and also want to save it to disk:
139
+
```python
140
+
from pyimagecuda import Image, ImageU8, convert_float_to_u8, save_u8
141
+
142
+
f32_img = Image(1920, 1080)
143
+
u8_img = ImageU8(1920, 1080)
144
+
145
+
# Process in float32
146
+
process(f32_img)
147
+
148
+
# Convert once for multiple uses
149
+
convert_float_to_u8(u8_img, f32_img)
150
+
151
+
# Use u8_img for display, OpenGL, etc.
152
+
display_opengl(u8_img)
153
+
154
+
# Save the same u8 buffer
155
+
save_u8(u8_img, "output.png")
156
+
```
157
+
158
+
**Note:** Most workflows use `save()` directly with float32 images. This function eliminates redundant conversion when you already have the uint8 buffer.
0 commit comments