def main(): print("What kind of filter would you like to apply?") print("Here are your options:") print("\n".join(filter_options)) answer = input() img = filters.load_img(IMAGE_NAME) while (answer.lower() != TINT.lower() and answer.lower() != OBAMICON.lower() and answer.lower() != GRAY.lower() and answer.lower() != INVERT.lower() and answer.lower() != PIXELATE.lower()): print("Invalid input! Please try again.") answer = input() if (answer.lower() == TINT.lower()): color = input( "What color would you like tinted? Red, Green, or Blue\n") while (color.lower() != BLUE and color.lower() != GREEN and color.lower() != RED): print("Invalid input! Please try again.") color = input() value = input( "How much do you want it added or subtracted? (Use positive numbers for add and negative for subtract\n" ) # exception handling value = check_num(value) filters.color_tint(img, color, value) elif (answer.lower() == OBAMICON.lower()): filters.obamicon(img) elif (answer.lower() == GRAY.lower()): filters.gray_scale(img) elif (answer.lower() == INVERT.lower()): filters.invert_colors(img) elif (answer.lower() == PIXELATE.lower()): print( "How much do you want to pixelate it by? Higher number means more pixelized." ) print( "If you enter a negative number, it'll take the absolute value of it." ) pixelized_value = input() pixelized_value = check_num(pixelized_value) while True: try: filters.pixelate(img, pixelized_value) break except filters.InvalidNum: pixelized_value = input("Try again!\n") pixelized_value = check_num(pixelized_value) filters.save_img(img, "new")
def main(): # ask what image the user wants to edit filename = input("Enter the name of the file you want to edit") # import the image img = filters.load_img(filename) # filters.show_img(img) # save the final image filters.save_img(img, "recolored.jpg") filters.obamicon(img)
def main(): #Ask what image the user wants to edit filename = input("Enter the name of the image file to edit: ") #Load the image from the specified filename img = filters.load_img(filename) #Ask which filter the user wants to use filter_choice = input( "Which filter would you like: obamicon, brighten, grayscale, or invert? " ) #Apply chosen filter if filter_choice == "obamicon": new_img = filters.obamicon(img) elif filter_choice == "brighten": new_img = filters.brighten(img) elif filter_choice == "invert": new_img = filters.invert_colors(img) elif filter_choice == "grayscale": new_img = filters.grayscale(img) else: print("Sorry, that is not an option.") #Save the final filtered Image filters.save_img(new_img, "recolored.jpg")
def main(): filename = input("Enter an image file to edit: ") im = filters.load_img(filename) filters.save_img(im, "picture.jpg") filters.show_img(im) pic = filters.obamicon(im) filters.show_img(pic)
def main(): filename = input("Enter file name: ") im = filters.load_img(filename) newimage = filters.obamicon(im) filters.show_img(newimage) filters.save_img(newimage, "newfilename.jpg")
def main(): file = input("What file are you trying to edit: ") img = filters.load_img(file) new_img = filters.obamicon(img) filters.save_img(img, "recolored.jpg")
def main(): filename = input('Enter the name of the image file to edit: ') img = filters.load_img(filename) obamicon_image = filters.obamicon(img) filters.save_img(obamicon_image, "recolored.jpg")
def main(): file = "cube.jpg" myimage = filters.load_img(file) filters.show_img(myimage) filtered = filters.obamicon(myimage) filters.save_img(filtered)
def main(): # Ask the user for a file filename = input("Enter the name of the image file to edit: ") # Load the image from the file img = filters.load_img(filename) #Apply the filters new_img = filters.obamicon(img) # Save the final Image filters.save_img(new_img, "gwcFilters.jpeg")
def main(): filename = input("Enter the name of the image file") #load image from the file img = filters.load_img(filename) #save the modified image obamicon = filters.obamicon(img) filters.show_img(obamicon) filters.save_img(obamicon, "recolored.jpeg")
def main(): # Ask what image the user wants to edit filename = input("Enter the name of the image file to edit: ") # Load the image from the specified file img = filters.load_img(filename) #Make new image newimg = filters.obamicon(img) # Save the final image filters.save_img(newimg, "recolored.jpg")
def main(): file = "flowers.jpg" myimage = filters.load_img(file) filters.show_img(myimage) color = input("What color do you want to emphasize? ") color_list = color.split(',') target_color = [int(value) for value in color_list] # filtered = filters.emphasize_yellow(myimage, target_color) filtered = filters.obamicon(myimage) filters.save_img(filtered, "cool_puppy.jpg")
def main(): filename = input("What is the file name of the picture you would like to edit?") print(filename) img = filters.load_img(filename) filters.show_img(filename,img) filter = input("Which filter would you like to use? \n Filter 1 \n Filter 2 \n Filter 3 \n Exit") if (filter == "filter 1"): filters.obamicon(img,filename) save = input("Would you like to save your image?") if save in yes: filters.save_img(filename, img) elif save in no: quit() else: save = input("Would you like to save your image?") elif (filter == "filter 2"): #add filter 2 save = input("Would you like to save your image?") if save in yes: save_img(filename, img) elif save in no: quit() else: save = input("Would you like to save your image?") elif (filter == "filter 3"): #add filter 3 save = input("Would you like to save your image?") if save in yes: save_img(filename, img) elif save in no: quit() else: save = input("Would you like to save your image?") elif (filter == "exit") quit() else: filter = input("Which filter would you like to use? \n Filter 1 \n Filter 2 \n Filter 3 \n Exit")
def ask(picture): print("What filter do you want to apply?") while True: res = input( "\nObamicon[o], Gray[g], Inverted[i], Yellow-Tinted[y], Quit[q] ") try: res = res.lower() except: print("Wrong Input. Please try again.\n") continue if res == 'o': print("...generating obamicon...") obamicon_pic = filters.obamicon(picture) curr_pic = obamicon_pic filters.show_img(obamicon_pic) elif res == 'g': print("...generating grayscale...") gray_pic = filters.gray(picture) curr_pic = gray_pic filters.show_img(gray_pic) elif res == 'i': print("...generating inverted...") inverted = filters.invert(picture) curr_pic = inverted filters.show_img(inverted) elif res == 'y': print("...generating yellow-tinted...") tinted_pic = filters.tint(picture) curr_pic = tinted_pic filters.show_img(tinted_pic) elif res == 'q': print("...quitting...\n") break else: print("Invalid response. Please Try Again.\n") continue print("success!\n") if (shouldSave()): newName(curr_pic) print("All Saved!\n")
def main(): #what image the user wants to edit filename = input("Enter the name of the image file to edit:") #Load the image from the specified filename img = filters.load_img(filename) #Apply filters newimg = filters.obamicon(img) newlen = filters.purple(img) #Save the final filtered image filters.save_img(newimg, "recolored.jpg") filters.save_img(newlen, "recolored.jpg")
def main(): filename = input("Enter the name of the image file to edit: ") img = filters.load_img(filename) newimg = filters.obamicon(img) newimg = filters.grayscale(newimg) blue = (30, 85, 115) anotherimg = filters.emphasize(img, blue, 50) blueimg = filters.add_color(img, blue) lastimg = filters.invert(blueimg) filters.save_img(newimg, "recolored1.jpg")
def main(): file = input("What file are you trying to edit: ") img = filters.load_img(file) new_img = filters.obamicon(img) gray_img = filters.grayscale(new_img) blue = (30, 85, 115) emph_img = filters.emphasize(img, blue, 50) blue_img = filters.add_color(img, blue) invert_img = filters.invert(blue_img) filters.save_img(gray_img, "recolored.jpg") filters.save_img(emph_img, "emph.jpg") filters.save_img(blue_img, "blue.jpg") filters.save_img(invert_img, "invert.jpg")
def main(): file_name = input("enter the name of the image file you want to edit: ") img = filters.load_img(file_name) new_img = filters.obamicon(img) new_img_2 = filters.greyscale(new_img) blue = (30, 85, 115) new_img_3 = filters.emphasize(img, blue, 50) new_img_4 = filters.add_color(img, blue) new_img_5 = filters.invert(new_img_4) #save filtered image as a new image filters.save_img(new_img_2, "new_im.jpg")
def main(): filename = input("Enter the name of the image file to edit: ") img = filters.load_img(filename) obamicon_image = filters.obamicon(img) filters.save_img(obamicon_image, "recolored.jpg") grayscale_image = filters.grayscale(img) filters.save_img(grayscale_image, "grayscale.jpg") inverted_image = filters.invert(img) filters.save_img(inverted_image, "inverted.jpg") bluescale_image = filters.blue_recolor(img) filters.save_img(bluescale_image, "blue_recolor.jpg")
def main(): filename = input("Enter the name of the file you want to edit:") #use load_img function from the file "filters". "img" is the image from the file in "filename" img= filters.load_img(filename) #makes the image into gray scale newim = filters.grayscale(img) filters.save_img(newim, "grayviolin.jpg") #makes image into light blue, red, dark blue, and yellow newimage = filters.obamicon(img) filters.save_img(newimage, "obamiconviolin.jpg") #makes image into inverted colors image2 = filters.invertcolors(img) filters.save_img(image2, "invertedviolin.jpg") #else: just shows picture, if not grayscaled im = filters.show_img(img) filters.save_img(im, "violin.jpg")
def main(): filename = input("Enter the name of the image file to edit: ") img = filters.load_img(filename) filters.save_img(img, "newPic1.jpg") print("'O'bamicon, 'G'rayscale, 'P'urple?") while True: user_input = input() if user_input == "O": newimg = filters.obamicon(img) filters.save_img(newimg, "recolored.jpg") break if user_input == "G": newimg = filters.grayscale(img) filters.save_img(newimg, "recolored.jpg") break if user_input == "P": newimg = filters.purple(img) filters.save_img(newimg, "recolored.jpg") break
def main(): filename = input("Enter the name of the file you want to open: ") opened_image = filters.load_img(filename) # original image filters.show_img(opened_image) filters.save_img(opened_image, "image.jpeg") # obama filter obama_filter_image = filters.obamicon(opened_image) filters.show_img(obama_filter_image) filters.save_img(obama_filter_image, "obama.jpeg") # invert colors inverted_colors_image = filters.invertColors(opened_image) filters.show_img(inverted_colors_image) filters.save_img(inverted_colors_image, "inverted_colors.jpeg") # grayscale grayscale_image = filters.grayscale(opened_image) filters.show_img(grayscale_image) filters.save_img(grayscale_image, "grayscale.jpeg")
def main(): # Ask what image the user wants to edit filename = input("Enter the name of the image file to edit: ") # Load the image from the specified file img = filters.load_img(filename) # Apply filters! newimg = filters.obamicon(img) newimg = filters.grayscale(newimg) blue = (30, 85, 115) anotherimg = filters.emphasize(img, blue, 50) blueimg = filters.add_color(img, blue) lastimg = filters.invert(blueimg) # Save the final images filters.save_img(newimg, "recolored1.jpg") filters.save_img(anotherimg, "recolored2.jpg") filters.save_img(blueimg, "recolored3.jpg") filters.save_img(lastimg, "recolored4.jpg")
import filters picture = filters.load_img("funny-dog.jpg") filters.obamicon(picture) filters.show_img(picture)
def main(): filename = input("Enter file name: ") img = filters.load_img(filename) new_img = filters.obamicon(img) filters.save_img(new_img, "new_img.jpg")
def main(): filename = "obama.jpg" img = filters.load_img(filename) filters.obamicon(img) img.show()
def main(): img = load_img("bp.jpg") filters.obamicon(img) save_img(img, "jisoos.jpg") print(saved_img.title)
def main(): userInput = input("Enter file name: ") im = filters.load_img(userInput) newImage = filters.obamicon(im) filters.show_img(newImage) filters.save_img(newImage, "newPic.jpg")
def main(): image = filters.load_img("owl.jpg") filters.save_img(image, "owl_2.jpg") filter_image = filters.obamicon(image) filters.show_img(filter_image)
def main(): img = filters.load_img("image5.jpg") filters.obamicon(img)