Git Product home page Git Product logo

pibooth-picture-template's Introduction

Pibooth

Python 3.6+ PyPi package PyPi downloads Tests Codecov

The pibooth project provides a photobooth application out-of-the-box in pure Python for Raspberry Pi. Have a look to the wiki to discover some realizations from GitHub users, and don't hesitate to send us photos of your version.

Settings

Features

  • Interface available in Danish, Dutch, English, French, German, Hungarian, Norwegian, Portuguese (Portugal and Brazil), Spanish and Swedish (customizable)
  • Capture from 1 to 4 photos and concatenate them in a final picture
  • Support all cameras compatible with gPhoto2, OpenCV and Raspberry Pi
  • Support for hardware buttons and lamps on Raspberry Pi GPIO
  • Fully driven from hardware buttons / keyboard / mouse / touchscreen
  • Auto-start at the Raspberry Pi startup
  • Animate captures from the last sequence during idle time
  • Store final pictures and the individual captures
  • Printing final pictures using CUPS server (printing queue indication)
  • Custom texts can be added on the final picture (customizable fonts, colors, alignments)
  • Custom background(s) and overlay(s) can be added on the final picture
  • All settings available in a configuration file (most common options in a graphical interface)
  • Highly customizable thanks to its plugin system, you can install plugins developed by the community from PyPI or develop your own plugin.

Documentation

Documentation

Plugins

Here is a list of known plugins compatible with Pibooth

Pibooth organisation's plugin

Third-party plugins

Third-party plugins can be found on GitHub or on plugins on PyPI. Here is a short list:

Sponsors

An enormous thanks to our sponsors:

It means a lot to us!

pibooth-picture-template's People

Contributors

anxuae avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pibooth-picture-template's Issues

Customiser template avec image ou theme

Bonjour je vois dans votre presentation que l'ont peut organiser les images mais est il possible de mettre des themes, images de fond ou autres????

Merci de votre aide et bravo pour votre travail

Template

Hello, sorry for asking another stupid question. My photobooth finally works the way it should work except that I don't succeed to change the picture template at the end. I succeeded in changing it using the plugin "pibooth picture template" saved it under EllaSimon2.xml. According to the info on the screen all should be OK except that the final pictures are not put together using that template. It looks like photobooth is using 'TemplatePictureFactory' as a template I think? Any suggestion??

logging file:

[ INFO ] pibooth : Initialize Google Photos connection
[ INFO ] pibooth : Show picture choice (4 captures selected)
[ INFO ] pibooth : Show preview before next capture
[ INFO ] pibooth : Take a capture
[ INFO ] pibooth : Show preview before next capture
[ INFO ] pibooth : Take a capture
[ INFO ] pibooth : Show preview before next capture
[ INFO ] pibooth : Take a capture
[ INFO ] pibooth : Show preview before next capture
[ INFO ] pibooth : Take a capture
[ INFO ] pibooth : Saving raw captures
[ INFO ] pibooth : Creating the final picture
[ INFO ] pibooth : Parsing pictures template file: /home/pb/Downloads/EllaSimon2.xml
[ INFO ] pibooth : Found template 'Page-1': 1 captures - 2 texts
[ INFO ] pibooth : Found template 'Page-2': 2 captures - 2 texts
[ INFO ] pibooth : Found template 'Page-3': 3 captures - 2 texts
[ INFO ] pibooth : Found template 'Page-4': 4 captures - 2 texts
[ INFO ] pibooth : Found template 'Page-5': 1 captures - 2 texts
[ INFO ] pibooth : Found template 'Page-6': 2 captures - 2 texts
[ INFO ] pibooth : Found template 'Page-7': 3 captures - 2 texts
[ INFO ] pibooth : Found template 'Page-8': 4 captures - 2 texts
[ INFO ] pibooth : Use TemplatePictureFactory to create background
[ INFO ] pibooth : Use TemplatePictureFactory to concatenate images
[ INFO ] pibooth : Use TemplatePictureFactory to assemble final image
[ INFO ] pibooth : Use TemplatePictureFactory to draw texts
[ INFO ] pibooth : Save image '/media/pb/PHOTOBOOTH/EllaSimon/2022-08-07-21-57-23_pibooth.jpg'
[ INFO ] pibooth : Found existing Google Photos album 'pibooth'

thanks for any help...

regards,

Joost

Error when adding an image to the template

Hi,
I am looking to add a static image to the resulting template. The image will be the same on every resulting photo array.

I have created the template in draw.io and imported it into Pibooth. I have regenerated the images (pibooth-regen) but I am seeing the following error message:
"pibooth_picture_template.TemplateParserError: Too many captures positions (5) in template 'Page-1' (1 to 4 expected)"

I have included the xml I am using as a TXT file
photograph.txt

Creating template with designs

Hello, I tried to create a template in Flowchart Maker and inserted a .png file as background (see image attached). However, when I try to use the .xml as template in Pibooth, instead of listing the found templates, it gives me an error message with "too many values to unpack (expected 2)". What am I doing wrong and what do I need to do to add images as backgrounds in my templates? Thanks in advance.

Bildschirmfoto 2022-06-30 um 17 10 19

d

Can't use one raw image twice on template

Hallo,
I'm copying my issue from pibooth/pibooth#309 to here because it probably is a problem of the plugin.

Hallo everyone,

first I want to thank you all for this open-source software I'm very happy to use it for my first hobby Photobooth.

I want to print one image with 3 different photos each one should be appear twice on the template.

When using the example template everything is fine, also when I edit it a bit. As soon as I duplicate the placeholders and try to use the template I get the error:

No template for '6' captures

Because pibooth thinks I have 6 placeholders in the xml-file - eventhouth I only have 3 different placeholders duplicated ( 1-2-3 and 1-2-3).

Is there a workaround to get 1 capture twice on one processed image?

Thank you in advance!

Background Image not showing

Hi, i put a background image as png to /home/pibooth/.config/pibooth/test.xml and added the path on pibooth.cfg under Picture backgrounds it still remains white so i tried it on overlays still the same. can someone help me please i didn't find any instructions either.

Display multi-line text

Hi Pibooth team,

Alongside my Photo Booth, I am running a webserver to enable users access to the photographs via their phones. I have written a plugin to display a "See instructions to view on your phone" after finish state. (Code below - I have removed my attempts at multi line fixes, to simplify and ensure working code)
However, as I am using a 10" screen I need the text to span two lines to ensure the font is big enough. Currently i cannot get it to move on to a second line.
Please advise on if you have any recommendations?

Plugin name: view_on_phone_message.py

"""Plugin to display 'View on your phone' at screen after 'finish' state."""

import time
import pygame
import pibooth
from pibooth import pictures, fonts

__version__ = "0.0.1"


@pibooth.hookimpl
def state_finish_exit(win):
    win_rect = win.surface.get_rect()
    text = '''See Instructions to view on your phone!'''

    # Get best font size according to window size
    font = fonts.get_pygame_font(text, fonts.CURRENT,
                                 win_rect.width//1.5, win_rect.height//1.5)

    # Build a surface to display at screen
    text_surface = font.render(text, True, win.text_color)

    # Clear screen
    if isinstance(win.bg_color, (tuple, list)):
        win.surface.fill(win.bg_color)
    else:
        bg_surface = pictures.get_pygame_image(win.bg_color, win_rect.size, crop=True, color=None)
        win.surface.blit(bg_surface, (0, 0))

    # Draw the surface at screen
    win.surface.blit(text_surface, text_surface.get_rect(center=win_rect.center).topleft)

    # Force screen update and events process
    pygame.display.update()
    pygame.event.pump()

    # Wait 3s
    time.sleep(3)

Probleme with template

good morning.
I can't put a template that I created.
it tells me an error when processing the photo.
I created an .xml file which I copied to the config folder of pibooth.
when I put the classic template file everything works.

What to place in Config ?

Hello

I feel confused about what to change into the configuration file after installation.

It is written to add
template = picture_template.xml on the Picture section

But where afterward is done the final choice, e.g. to activate the new template fancy.xml ?

use a background on template

Hi there,

I'm trying to appl ya background on my photo,
But when I apply it, texts and photos disappear, I'm using a 6x4in and .png image like it recommanded.

Thanks for help
2023-12-15-14-16-55_pibooth
2024-05-30-16-07-31_pibooth-1

Template using images multiple times does not work

I am trying to make a template for a classical style photobooth output; 2 or three images stacked on each other (like here: https://github.com/pibooth/pibooth-picture-template#user-content-step-5-add-new-a-template)

I have a template (the file is named "two") for two images, each used twice (so exactly like in the example linked above), but when I run pibooth-regen to test the template, I get the INFO line

INFO:pibooth:Found template 'two': 4 captures - 4 texts

And the error line

pibooth_picture_template.TemplateParserError: No template for '2' captures (orientation=portrait)

You can see the contents of the xml file below.

two_pics.drawio.txt

My pibooth config is below

pibooth_10_11_22.txt

How do I get pibooth to create the image with two captures duplicated?

Symetrical template

Hi,
Is it possible to create a symetrical template as shown in the following picture ? Photos would be the same in the 2 columns. The main idea is to be able to cut the 4*6 print in two to share between guests (and reproduce a strip photo style).
template_sym

How import XML generate ?

Hi,
In this tuto it is explain how to create the picture template, and how export it as XML.
But what you have to do after export this XML?
Where we have to put it?

Thanks

Pibooth blocked on "Thank you" page - Problem with overlay ?

Hello everyone,

First of all, thanks a lot for your application and your work.
I am a beginner in RPI and it helped me a lot in my project for my father's birthday this summer.

For some days now I am having an issue though, maybe you'll have an idea what's going wrong.

I am working with the editable/customizable version because I wanted to make some modifications, essentially esthetic (change the angle and size of the arrows, leds light continuously instead of blinking etc.)
It worked perfectly well, even after having operated my changes (or I would have known that I did something wrong).
Then I began to work on backgrounds and overlays, and that is when I started to have some problems.

I configured for a "1 photo" and a "3 photos" choice. The 2 templates share the same background, but have their own layout.
For the "1 photo" choice, everything works fine.

For the "3 photos" choice however, I have some trouble.
At the beginning, I had the following problem every 5 or 6 time or so, but now it is every time I choose the "3 photos" option.

Everything is ok until I arrive at the "final picture" step. I can see the picture with its background, its 3 photos and its overlay, everything seems to be normal (except that it can be a bit long, but this is not the main problem).
After that, whichever action is chosen (press "print", press "forget" or wait until it goes back to the main menu), it takes a veeery long time before it goes to the next step, in which you see the "Thank you" message. What's more, when it finally arrives ont the "Thank you" page, it blocks in it forever, and the only thing I can do is stop the process (I even let it for more than 1 hour on the "Thank you" page to see if it was just very long, but it did not work, it did not come back on the main menu on its own).

Here are the steps indicated in the terminal, I can't see anything that went wrong in there :

[ INFO    ] pibooth           : Show picture choice (nothing selected)
[ INFO    ] pibooth           : Show picture choice (3 captures selected)
[ INFO    ] pibooth           : Show preview before next capture
[ INFO    ] pibooth           : Take a capture
[ INFO    ] pibooth           : Show preview before next capture
[ INFO    ] pibooth           : Take a capture
[ INFO    ] pibooth           : Show preview before next capture
[ INFO    ] pibooth           : Take a capture
[ INFO    ] pibooth           : Saving raw captures
[ INFO    ] pibooth           : Creating the final picture
[ INFO    ] pibooth           : Parsing pictures template file: /home/pi/.config/pibooth/picture_template_JC.xml
[ INFO    ] pibooth           : Found template 'Page-1': 1 captures - 0 texts
[ INFO    ] pibooth           : Found template 'Page-2': 2 captures - 2 texts
[ INFO    ] pibooth           : Found template 'Page-3': 3 captures - 0 texts
[ INFO    ] pibooth           : Found template 'Page-5': 1 captures - 2 texts
[ INFO    ] pibooth           : Found template 'Page-6': 2 captures - 2 texts
[ INFO    ] pibooth           : Found template 'Page-7': 3 captures - 2 texts
[ INFO    ] pibooth           : Found template 'Page-8': 4 captures - 2 texts
[ INFO    ] pibooth           : Use TemplatePictureFactory to create background
[ INFO    ] pibooth           : Use TemplatePictureFactory to concatenate images
[ INFO    ] pibooth           : Use TemplatePictureFactory to assemble final image
[ INFO    ] pibooth           : Use TemplatePictureFactory to draw texts
[ INFO    ] pibooth           : Save image '/media/pi/USB DISK/2021-06-05-10-56-12_pibooth.jpg'
[ INFO    ] pibooth           : Asyncronously generate pictures for animation
[ INFO    ] pibooth           : Uploading into EXISTING photo album -- '60 ans JC'
[ INFO    ] pibooth           : Uploading photo -- '/media/pi/USB DISK/2021-06-05-10-56-12_pibooth.jpg'
[ INFO    ] pibooth           : Added '2021-06-05-10-56-12_pibooth.jpg' to library and album '60 ans JC' 
[ INFO    ] pibooth           : Display the final picture
pygame 2.0.1 (SDL 2.0.9, Python 3.7.3)
Hello from the pygame community. https://www.pygame.org/contribute.html
pygame 2.0.1 (SDL 2.0.9, Python 3.7.3)
pygame 2.0.1 (SDL 2.0.9, Python 3.7.3)
Hello from the pygame community. https://www.pygame.org/contribute.html
Hello from the pygame community. https://www.pygame.org/contribute.html

Here is the moment when I'm blocked on the "Thank you" page and I can't do anything more except stop the process.
Update : I have noticed that when I choose the "1 photo" option, I never have the last 6 lines ("pygame 2.0.1 ...", "Hello from the pygame community" etc.), and it occurs when the pibooth seems to block on the page.

Then I have :

Processus arrêté
pi@raspberrypi:~ $ /usr/lib/python3.7/multiprocessing/semaphore_tracker.py:144: UserWarning: semaphore_tracker: There appear to be 4 leaked semaphores to clean up at shutdown
  len(cache))

Once or twice, I had an error when pressing the "forget" button. Instead of just blocking on the "Thank you" page, I have the following :

[ INFO    ] pibooth           : Display the final picture
[ INFO    ] pibooth           : Moving the picture in the forget folder
[ ERROR   ] pibooth           : 
[ ERROR   ] pibooth           : 
Traceback (most recent call last):
  File "/home/pi/pibooth/pibooth/booth.py", line 377, in main_loop
    self._machine.process(events)
  File "/home/pi/pibooth/pibooth/states.py", line 64, in process
    self.set_state(new_state_name)
  File "/home/pi/pibooth/pibooth/states.py", line 91, in set_state
    hook(cfg=self.cfg, app=self.app, win=self.win)
  File "/usr/local/lib/python3.7/dist-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/usr/local/lib/python3.7/dist-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/usr/local/lib/python3.7/dist-packages/pluggy/manager.py", line 337, in traced_hookexec
    return outcome.get_result()
  File "/usr/local/lib/python3.7/dist-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/usr/local/lib/python3.7/dist-packages/pluggy/callers.py", line 52, in from_call
    result = func()
  File "/usr/local/lib/python3.7/dist-packages/pluggy/manager.py", line 335, in <lambda>
    outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))
  File "/usr/local/lib/python3.7/dist-packages/pluggy/manager.py", line 87, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/usr/local/lib/python3.7/dist-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/usr/local/lib/python3.7/dist-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/usr/local/lib/python3.7/dist-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/home/pi/pibooth/pibooth/plugins/picture_plugin.py", line 69, in state_failsafe_enter
    self._reset_vars(app)
  File "/home/pi/pibooth/pibooth/plugins/picture_plugin.py", line 26, in _reset_vars
    self.factory_pool.clear()
  File "/home/pi/pibooth/pibooth/pictures/pool.py", line 28, in clear
    res.get(5)
  File "/usr/lib/python3.7/multiprocessing/pool.py", line 653, in get
    raise TimeoutError
multiprocessing.context.TimeoutError
[ ERROR   ] pibooth           : system='Linux', node='raspberrypi', release='5.10.17-v7+', version='#1414 SMP Fri Apr 30 13:18:35 BST 2021', machine='armv7l', processor=''
 ***********************************************************************************
 *                     Oops! It seems that pibooth has crached                     *
 *     You can report an issue on https://github.com/pibooth/pibooth/issues/new    *
 *                       and post the file: /tmp/pibooth.log                       *
 ***********************************************************************************

I attached the pibooth.log I have in this case.
pibooth.log

Update 2 : I made some tests and it appears that it is the use of an overlay with the "3 photos" option which seems to cause the problem. If I have no overlay chosen in the config, it works fine (for both "1 photo" and "3 photos").
When I add an overlay, it works for the "1 photo" but I have the problem described above with the "3 photos".

Do you have any idea what's wrong ?

Thank you very much in advance for your help.

Environment

  • OS Raspbian 10 Buster
  • Camera Rpi camera - I had to set the GPU memory on 256 to make it work properly with the pibooth
  • Pibooth version 2.0.3
  • Plugins used : templates, QRcode

Not printing, pi cam not working

I have installed PiBooth as documented. A standard install with all standard functionalities (no plugins etc.)
The application is working okay. Accept 2 issues:

  1. When photo is send to printqueue it doesn't send it to the printer. It keeps 'hanging'in the printqueue. However when printing it from another application it is printing directly.
  2. The Pi cam is not recognised by PiBooth, no error code. When checking with another application it is working fine. An USB WebCam is connected as work around.
    I am a beginner with Python and Rasp Pi.
    What could be wrong?

Share your templates !

This is not an issue so much as a lightweight to share your picture templates.

😜 Remember, if you like this project, add a star ⭐.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.