Convert To CSV file

I an unable to convert my collage into a csv file with r,g,b format.I have made the collage successfully.Please help me to convert it into csv file

Hey @Shashitarwey, What problem you are facing ?..Just store your image pixel values in a pandas dataframe. Then use df.to_csv() function to convert your dataframe into a csv file.

I hope this helps ! :+1:
Please mark the doubt as resolved in your doubts section ! :slight_smile:
Happy Learning ! :slightly_smiling_face:

it shows error must pass 2d input

so i reshape it in 430x1290 size but when passing header name as r,g,b it shows error again

Hey @Shashitarwey, you have to store the r,g,b values in the csv file. So you cannot reshape the (430,430,3) image into (430,430x3) image. Since we want to preserve the number of channels, please rehsape the image as (430x430 , 3) i.e. (184900,3).

Then you can store these values in 3 columns easily. I hope this helps !
Please mark the doubt as resolved in your doubts section ! :+1:
Happy Learning ! :slightly_smiling_face:

Thank you…Now it works