Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samples/python/04_julia/julia.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@
" cl.map_flags.READ, \n",
" 0, width * height, np.uint32)\n",
" with mapped_dst.base:\n",
" (r, g, b, a) = Image.fromarray(mapped_dst.reshape((width, height)), 'RGBA').split()\n",
" (r, g, b, a) = Image.fromarray(mapped_dst.view(np.uint8).reshape((height, width, 4))).split()\n",
" image = Image.merge('RGB', (r, g, b))"
]
},
Expand Down
2 changes: 1 addition & 1 deletion samples/python/04_julia/julia.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
0, gwx * gwy, np.uint32)
with mapped_dst.base:
# note: this generates a 24-bit .bmp file instead of a 32-bit .bmp file!
(r, g, b, a) = Image.fromarray(mapped_dst.reshape((gwy, gwx)), 'RGBA').split()
(r, g, b, a) = Image.fromarray(mapped_dst.view(np.uint8).reshape((gwy, gwx, 4))).split()
image = Image.merge('RGB', (r, g, b))
image.save(filename)
print('Wrote image file {}'.format(filename))
4 changes: 2 additions & 2 deletions samples/python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
matplotlib==3.8.2
matplotlib==3.10.9
numpy==1.26.3
pyopencl==2023.1.4
pillow==12.3.0
pillow==13.0.0

jupyterlab==4.5.11
Loading