Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Mojo Pointer to Python bytes? - Modular
M
Modular
•
3y ago
•
1 reply
Sam Nardoni
Mojo Pointer to Python bytes?
Hello
,
Is there a way to create a Python
bytes
bytes
object from a Mojo
Pointer
Pointer
?
Context
: I have image
/pixel data stored in contiguous memory in Mojo
-land
. I want to load this into Python
-land using pillow
. Pillow offers a
Image.frombytes
Image.frombytes
function
, which seems like it may do the job
. But I need to provide it a Python
bytes
bytes
. I don
't mind if the data is copied
.
I
've tried setting the data pixel
-by
-pixel
, but it is sssllloooowwwww
.
Modular
Join
This server is the home of the MAX and Mojo community! Join us to chat about all things Modular.
20,199
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Mojo code to python?
M
Modular / questions
3y ago
using mojo in python (not python in mojo)
M
Modular / questions
3y ago
Python w Mojo
M
Modular / questions
3y ago
Compile Mojo Python
M
Modular / questions
3y ago