Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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")
Exemplo n.º 3
0
def main():
    filename = input("Enter the image name you want to edit: ")

    img = filters.load_img(filename)

    newImage = filters.greyscale(img)
    filters.show_img(newImage)
    filters.save_img(newImage, "newBanana.jpeg")
Exemplo n.º 4
0
def main():
    file = "cube.jpg"

    myimage = filters.load_img(file)
    filters.show_img(myimage)

    filtered = filters.obamicon(myimage)
    filters.save_img(filtered)
Exemplo n.º 5
0
def main():
    filename = input("Enter the name image you want to edit: ")

    image = filters.load_img(filename)

    image.save(image, "editedImage.jpeg")

    image.show()
Exemplo n.º 6
0
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():
    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")
Exemplo n.º 8
0
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")
Exemplo n.º 9
0
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 image file to edit: ")

    # Load the image from the specified file
    img = filters.load_img(filename)

    # Save the final image (name the file)
    filters.save_img(img, "recolored.jpg")
Exemplo n.º 11
0
def validPath():
    while True:
        fileName = input("Enter a file name: ")
        try:
            pic = filters.load_img(fileName)
            print("Success!\n")
            return pic
        except FileNotFoundError:
            print("Unable to open the file. Try Again.\n")
def main():

    # how to represent a file name?
    # need the image path
    # https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/file---image-file-path
    # example: /Users/brookeryan/Downloads/giphy-4.gif
    img = filters.load_img("/Users/brookeryan/giphy-2.gif")
    filters.show_img(img)
    filters.save_img(img, "cool")
Exemplo n.º 13
0
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.my_filter2(img)
    # Save the final Image
    filters.save_img(new_img, "gwcFilters.jpg")
Exemplo n.º 14
0
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)
Exemplo n.º 15
0
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")
Exemplo n.º 16
0
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
    im = filters.load_img(filename)

    # # Apply filters!
    # newimg = filters.obamicon(img)

    im.show()
Exemplo n.º 17
0
def main():
    filename = input("Enter file name: ")

    im = filters.load_img(filename)


    filters.show_img(im)
    filters.save+img(im, "newfilename. jpg")


    if__name__== '__main__':
        main()
Exemplo n.º 18
0
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)

    newImage = classFilters.dogFilter(img)

    filters.save_img(newImage, "newImage.jpg")
Exemplo n.º 19
0
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")
Exemplo n.º 20
0
def main():
    # Ask what image the user wants to edit
    filename = input("Enter filename: ")

    #Load the image from the specified file
    img = filters.load_img(filename)

    #Apply Filters
    newimg = filters.obamicon(img)

    #Save the final image
    filters.save_img(img, "recolored.jpg")
Exemplo n.º 21
0
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)

    #Apply filters!!
    newimg = filters.obamicon(img)

    # Save the final filtered image
    filters.save_img(newimg, "recolored.jpg")
Exemplo n.º 22
0
def main():
    # ask user for filename to modify
    filename = input("Enter the name of the image file:  ")
    #print(filename)

    #load the image
    image = filters.load_img(filename)

    #obama
    new_image = filters.invert(image)

    #save new image
    filters.save_img(new_image, "filtered.jpg")
Exemplo n.º 23
0
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)
    grayimg = filters.grayscale(img)

    # Save the final image
    filters.save_img(newimg, "recolored.jpg")
Exemplo n.º 24
0
def main():
    imagenames = [
        'capamerica', 'obamaphone', 'obamababy', 'obamababy2', 'obamababy3'
    ]
    print("What image would you like to edit?")
    print(imagenames)
    filename = input("Which image would you like to edit? ")

    # load the image from the file picked
    original_img = filters.load_img(filename)
    original_img.show()

    filtered_img = filters.obamacon(original_img)
    filtered_img.show()
Exemplo n.º 25
0
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")
Exemplo n.º 26
0
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")
Exemplo n.º 27
0
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")
Exemplo n.º 28
0
def main():
    #load the image to apply filters to
    #change "hannah-eli.jpg" to own image file name. image file must be in same directory as python files
    newImg = filters.load_img("group-pic.jpg")
    ''' #show the image to the user
        #filters.show_img(newImg)
    #save the new image
        #filters.save_img(newImg, "group-pic2.jpg")
    #apply obamicon
    obamiconImg = filters.obamicon(newImg)
        #filters.show_img(obamiconImg)
    filters.save_img(obamiconImg, "group-obamicon.jpg")
    '''
    #apply and save inverted pic
    invertImg = filters.invert2(newImg)
    filters.show_img(invertImg)
    filters.save_img(invertImg, "group-invert.jpg")
    #apply and save warm filter
    '''warmImg = filters.warm(newImg)
Exemplo n.º 29
0
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")
Exemplo n.º 30
0
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")