Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+3 votes

Hi friends, does anyone have any tips for getting started with art.maker.py? i am confused on the line saying "the convert method must create an image object?"

do you have to open the file for writing??... or reading?

asked in CSC201 Spring 2021 by (8 points)

1 Answer

+3 votes
 
Best answer

1) The Image class is part of our graphics library. Check the graphics reference for how to create a new Image object, by providing the GIF file name and a location for drawing (which isn't important since we aren't drawing it in the window... we're just extracting color information from pixels at random locations within the image.)

2) You'll want to create a new text file, so you will open that file for writing, but note that the file you're opening for writing is NOT the gif image file... it's a file that has the same name except that it should end in .art instead of .gif.

If you open the gif file name for writing you will overwrite the original photograph file!

answered by (17.9k points)
selected by
...