Python Programming Tutorial - 44 - Combine Images Together

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

I have been watching thenewboston's videos since I decided to become a dev back in 2015. I keep coming back to them or finding new ones the more I grow as dev. Love your content brother!

davd_andrew
Автор

i actually needed this for my game. thanks!

chronowendigo
Автор

You can even pass the area like area = (200, 200), no need the last two parameters. So no need calculation :-)

mrsamsebastian
Автор

if someone has problems cuz of coordinates, like i did, but just really wants to see results on their computer like i did,
you can do it like i did
# superwatermelon.py in work

from PIL import Image # if you didn't install it cuz you don't pycharm, just go to cmd.exe and write python - m pip install Pillow

img = Image.open('images1.jpg') # open first image
img2 = Image.open('images.jpg') # open second image
area = (25, 25, 151,151) #just some random coordinates...
img2 = img2.crop(area) # now my image size was identical to first image so i decided to crop it.

img.paste(img2, area) # so now i just paste it with same coordinates, since this and crop coordinates are same. it fits perfectly
# other way to do it, witchout crop, just use smaller second image and don't put any coordinates.img.paste(img2)
img.show() # so lets see the result

namelast-name
Автор

It’s been 8 years from this tutorial, I have a issue, I want to put an png img above other, but some reason is not displayed

joaquin
Автор

Is there a way to make the foreground transparent without photoshopping the image itself?
In your case, making 'girl' semi transparent?

jakedenecochea
Автор

Hey Buckey!
Great videos. I was wondering, why would you use python as an image editor and not just Photoshop?

ENJI
Автор

Hey Bucky.
I don't really get where you get the 300 in: area = (100, 100, 300, 300)
I have try to make some change int the AREA but then I will only get error.

ymmijjohnsson
Автор

I am building a dataset by combining images together so how can this be done for multiple images?
1image copied to multiple images at once

oliaman
Автор

I am getting error saying no such file found(the file which is to be placed). It is in the same directory

ninadvirkar
Автор

Is there a possibility on codes that you can paste image on center without giving its coordinate? my second image was random size.

XxXblackemotionxXx