Pixel based analysis of landsat satellite image Using python codes

Joined
May 1, 2023
Messages
1
Reaction score
0
I am work on a dissertation project. I am doing "urban heat island" project and working on landsat images. so I need python codes to make the thermal image into pixelized to find the hotspot of an area. If anyone have the coding pls share. For reference i attached the file that how i need an output.
 

Attachments

  • refer.png
    refer.png
    67.3 KB · Views: 6
Joined
Mar 31, 2023
Messages
95
Reaction score
8
To pixelize thermal images, you can use the PIL (Python Imaging Library) module in Python. You can use the resize() method of PIL to resize the image to a lower resolution. Here's an example code snippet to pixelize a thermal image:
Python:
from PIL import Image

# open the thermal image
thermal_img = Image.open('thermal_image.jpg')

# resize the thermal image to a lower resolution
pixelized_img = thermal_img.resize((100, 100), resample=Image.BOX)

# save the pixelized image
pixelized_img.save('pixelized_image.jpg')
In the above code, we first import the Image class from the PIL module. We then open the thermal image using the open() method and store it in the thermal_img variable. We then resize the thermal image to a lower resolution of 100x100 pixels using the resize() method and store it in the pixelized_img variable. Finally, we save the pixelized image using the save() method.

You can modify the resolution as per your requirements to get the desired level of pixelization.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,516
Members
44,991
Latest member
Josephnag

Latest Threads

Top