Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
creating an image
#1
Hi,
I have a CSV file with numbers I would like to show this file as an image where each number represent a pixel value.How do I do it in Python?
Where can I find material on image show in Python ?
Thanks
Reply
#2
import numpy as np
from matplotlib import pyplot as plt

# Generates an 50x50 array with random values between 0-1
# You must load your CSV into data
data = np.random.random((50, 50))

# Create the image and show it
plt.imshow(data, interpolation='nearest')
plt.show()
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020