Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom text and image to photo #5

Open
aa0pb opened this issue Jul 20, 2016 · 7 comments
Open

Add custom text and image to photo #5

aa0pb opened this issue Jul 20, 2016 · 7 comments

Comments

@aa0pb
Copy link

aa0pb commented Jul 20, 2016

Howdy,
I am working on a similar project for a non-profit. My first go around with it I looped the photo thru FBI to add an image and text (Event name) to the photo before it was viewed and saved. Any thoughts on that?

Also any plans to add other social media feeds?

Looking forward to playing with this,
Phil

@jrleeman
Copy link
Owner

I think the text could be done using PIL. What specific platforms do you have in mind? I wasn't planning on adding any, but there should be Python bindings for most.

@aa0pb
Copy link
Author

aa0pb commented Jul 20, 2016

I do not know PIL, but I'll have to look. I have a basic Raspberry PI B with the camera that I am rebuilding. I am going to follow the Nuts and Bolts article as a starting point then tweak as I go.

I am going to have another box that has a running slideshow of all the photos so far, and add the non-proft logo to the corner. It is for a kids non-proft, so making it fun for them.

@jrleeman
Copy link
Owner

I wonder if uploading to dropbox might be a good solution?

On Jul 20, 2016, at 4:45 PM, aa0pb notifications@github.com wrote:

I do not know PIL, but I'll have to look. I have a basic Raspberry PI B with the camera that I am rebuilding. I am going to follow the Nuts and Bolts article as a starting point then tweak as I go.

I am going to have another box that has a running slideshow of all the photos so far, and add the non-proft logo to the corner. It is for a kids non-proft, so making it fun for them.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub #5 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AAT2lYDE7AqCwmBpXdmaexdgmEMizmKKks5qXpbdgaJpZM4JRFkw.

@aa0pb
Copy link
Author

aa0pb commented Jul 20, 2016

Might for a backup, I am planning on a shared folder. Unless you have a better idea.

@jrleeman jrleeman changed the title Adds to the project Add custom text and image to photo Jul 22, 2016
@jrleeman
Copy link
Owner

It would be a fine solution. I'm not sure when I'll get to play with adding the text and images, but feel free to ping me on it!

@jrleeman
Copy link
Owner

jrleeman commented Oct 22, 2016

Here's a working example of adding an image and text to an existing image using PIL. Any ideas for the interface to specify this? I'm thinking a key-value pair text file where you could specify the text, it's position, size, font and a logo image and it's position. If either is unpopulated it just ignores it. Also an option to save the originals or just save the images with overlays.

from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw

img = Image.open("sample_in.jpg")
draw = ImageDraw.Draw(img)
# font = ImageFont.truetype(<font-file>, <font-size>)
font = ImageFont.truetype("Xoxoxa.ttf", 26)
# draw.text((x, y),"Sample Text",(r,g,b))
draw.text((5, 5),"Leeman Wedding",(255,255,255),font=font)
draw.text((5, 30),"PiBooth",(255,255,255),font=font)

logo = Image.open("logo.jpeg")

img.paste(logo, (700, 300))
img.save('sample-out.jpg')

@jrleeman
Copy link
Owner

I think config parse is a good solution: https://docs.python.org/3/library/configparser.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants