Skip to main content

Convert RGB/RGBA image files to pandas dataframes, and vice versa

Project description

TwitterFacebookInstagramYouTubeWhatsAppWWWPinterestE-Mail


What can you do with Pd2img?

This package allows you to open image files and convert them to a pandas Dataframe After you are done with your work, you can save the dataframe as an Image

how to use it

Everything you need to know

from pd2img import Pd2Img
df = Pd2Img(r"C:\Users\Gamer\Documents\Downloads\WhatsApp Image 2022-04-21 at 5.07.14 PM.jpeg")  # creating an instance
df.to_file_rgb('f:\\testimagefile1.png')  # save the dataframe to an RGB image
df.to_file_rgba('f:\\testimagefile2.png')  # save the dataframe to an RGBA image 
np3 = df.to_numpy_rgb()  # convert the image to an numpy array (RGB, not BGR!)
np4 = df.to_numpy_rgba()  # convert the image to an numpy array (RGBA)

print(df.df)  # printing the dataframe
           y     x  red  green  blue
0          0     0  155    150   144
1          0     1  155    150   144
2          0     2  153    148   142
3          0     3  152    147   141
4          0     4  151    147   138
      ...   ...  ...    ...   ...
1224955  956  1275  189    190   185
1224956  956  1276  189    190   185
1224957  956  1277  189    190   185
1224958  956  1278  189    190   185
1224959  956  1279  189    190   185

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pd2img-0.0.3.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

pd2img-0.0.3-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page