A MATLAB script is provided which implements a number of image processing operations to remove the cloud from a satellite image. Open the image first and then convert it to grayscale in preparation for easy processing. The mask has a binary value of 1 for the clouds, while the others receive a binary value of 0. Thereafter, a morphological close with a disk structuring element was applied to the binary mask, closing up the small gaps inside the mask of the cloud. Post inversion, only non-cloudy parts of the mask are taken, based on which the median pixel value is going to replace the cloudy areas. Finally, after all these, original, cloud-masked and cloud-removed images are shown together for comparison, which explains very well the effectiveness brought in by the cloud removal process.