Question: By using python and cImage Package Write a program that will place a random number of stars at random positions in the night sky of
By using python and cImage Package
Write a program that will place a random number of stars at random positions in the night sky of this Harvest Moon picture.

Your program/function will have three parameters, viz. the file name of the picture ("harvestMoon.jpg"), and the minimum and maximum number of stars to be inserted. For example, the following would be a typical start of your program:
def assignment3(pic_file, min_stars, max_stars): # pic_file the Harvest Moon picture's file name # min_stars the minimum number of stars to be inserted, and # max_stars the maximum number of stars to be inserted
The number of stars chosen will be a random number between min_stars and max_stars inclusive and will:
1. be placed randomly in the night sky of the Harvest Moon picture 2. be randomly either a small star (single white pixel) or a large star (4 adjacent white pixels) 3. replace only a sky pixel or pixels (i.e. a 'star' will not be placed over a tree branch, the bird or the moon), i.e. not all stars chosen for random positions will actually be inserted. You only need to check that the first pixel of a large star would replace a sky pixel. You will probably use the distance() function (You can get the RGB values of typical sky pixels by accessing Pixel Explorer : https://yangcha.github.io/iview/iview.html
Additionally, a count of how many small and large stars that are inserted should be printed, as well as the total number of stars shown and the number of stars which could not be shown as they were hidden by the tree, the bird or the moon (see typical output.)

harvest Moon.jpg >>> random_stars ("harvestMoon.jpg", 500, 700) Total number of small stars inserted 177 Total number of large stars inserted 190 Thus, total number of stars inserted 367 Total number of obscured stars 222 >>>
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
