Ejemplo 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)
Ejemplo n.º 2
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")
Ejemplo n.º 3
0
def main():
    file = "cube.jpg"

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

    filtered = filters.obamicon(myimage)
    filters.save_img(filtered)
Ejemplo n.º 4
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():

    # 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")
Ejemplo n.º 6
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")
Ejemplo n.º 7
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()
Ejemplo n.º 8
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")
Ejemplo n.º 9
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)
Ejemplo n.º 10
0
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")
Ejemplo n.º 11
0
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")
Ejemplo n.º 12
0
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")
Ejemplo n.º 13
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")
Ejemplo n.º 14
0
def main():
    im = filters.load_img("HarpyEagleDrawing")
    filters.show_img(im)
Ejemplo n.º 15
0
def main():

    filename = input("Enter file name:\n")
    im = filters.load_img(filename)
    filters.show_img(im, filename)
Ejemplo n.º 16
0
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")
Ejemplo n.º 17
0
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)
Ejemplo n.º 18
0
def main():
    file_name = input("What is the filename you want to edit?")
    img = filters.load_img(file_name)

    filters.save_img(img, file_name)
    filters.show_img(img)
Ejemplo n.º 19
0
def main():
    image = filters.load_img("super_nova.jpg")
    new_image = filters.obamicon(image)
    filters.show_img(new_image)
Ejemplo n.º 20
0
def main():
    file = "cube.jpg"

    myimage = filters.load_img(file)
    filters.show_img(myimage)
Ejemplo n.º 21
0
def main():
    new_image = filters.obamicon('obama.jpg')
    filters.show_img(new_image)
Ejemplo n.º 22
0
def main():
    im = filters.load_img("hdcitylights.jpg")
    filtered_im = filters.grayscale(im)
    filters.show_img(filtered_im)
Ejemplo n.º 23
0
def main():
    filename = input("Enter the name image you want to edit: ")
    img = filters.load_img(filename)
    filters.save_img(img, "editedImage.jpeg")
    filteredImage = filters.obamacon(img)
    filters.show_img(filteredImage)
Ejemplo n.º 24
0
import filters

picture = filters.load_img("funny-dog.jpg")
filters.obamicon(picture)
filters.show_img(picture)
Ejemplo n.º 25
0
def main():
    while True:
        filters.load_img("dogPic.jpg")
        filters.show_img(image1)
        filters.save_img(image1, "dogPic.jpg")