Skip to content

Conversation

@youngbloodkyle
Copy link

@youngbloodkyle youngbloodkyle commented May 6, 2025

Hello! First off I want to say thank your for creating such a sick utility! The example image with the three posters made me really wish there was a way to generate wallpapers like that, thus the impetus for this PR.
Understand if you're not interested in merging the changes, as it might seem like it goes beyond the scope of the project, but I thought I would put together this PR in case you are interested in the functionality!

Changes:
poster.py: Added image return to pass the generated posters into the wallpaper.py
wallpaper.py: Calculates the correct poster size to embed in the given wallpaper dimensions. Also adds a drop shadow to each poster
cli/prompt.py: Adds prompting hopefully in line with the spirit of the original program, takes in 1-10 posters to create a wallpaper from. Takes in Wallpaper dimensions, and BG color. Guides users through repeated poster creations

Currently there are a few things that need to be improved, and more documentation needs to be added, but I'd like to gauge the interest in incorporating this into the main branch before I spend further time developing this. Attached are some wallpapers generated as example.

phoneWallpaper
landscapeWallpaper

Once again, thanks for making this great little program!!

@TrueMyst TrueMyst self-requested a review May 6, 2025 06:23
@TrueMyst TrueMyst self-assigned this May 6, 2025
@TrueMyst TrueMyst added the enhancement New feature or request label May 6, 2025
@TrueMyst TrueMyst moved this to In Progress in BeatPrints May 6, 2025
@TrueMyst
Copy link
Owner

TrueMyst commented May 6, 2025

Hi there! First of all, I just want to say how amazing this looks- I'm genuinely impressed by what you've come up with. I'm also really intrigued by how it all works! I would definitely want this feature to be in my project so don't you worry :>

My exams are going on at the moment, but I’ll definitely start working on it after June 10th. Looking forward to it! :>

@youngbloodkyle
Copy link
Author

youngbloodkyle commented May 7, 2025

Haha thanks! Your first image on the repo really inspired me. And good luck with finals!

Here's a full write up:

Changes

poster.py:

  • Added arg return_image, and optional return to both Track and Album methods. The return is to pass multiple poster instances to the wallpaper generator.
  • Added an if else block to deal with returning the poster(wallpaper path) vs saving the poster(poster path - current functionality)

prompt.py:

  • wrapped ps.track/ps.album in 'generated_image' to support returning the generated poster to the wallpaper path of the program
  • main function changes: replaced 'create_poster' with a user prompt, selecting Poster returns the user to the standard create_poster function, selecting Wallpaper walks through the wallpaper creation process
  • Wallpaper Creation:
    • select number of posters (limited to 10 now but thats an arbitrary choice)
    • User goes through n poster creation prompts
    • select Wallpaper width, height, and background color

wallpaper.py

  • draw_drop_shadow function: draws a drop shadow behind each poster (to the right and below)
    • could add in additional features to the drop shadow, right now its quite sharp and not very blurred, but its a matter of personal taste
  • generate_wallpaper function, takes in resolution, image paths, and bg color, does some math, to determine optimal spacing and pastes in the drop shadows, and the images
  • optimal spacing explained:
    • I set the spacing between images to be 1/8 the width of the generated poster. Above, below, and on the outsides of the images are additional margins that are set to be at least 1/4 the width of the generated poster.
    • if the wallpaper is very long, relative to the number of posters generated, then the outer horizontal gaps will be larger than 1/4 the width, and if the wallpaper is very tall relative to the overall width, the outer vertical gaps will be greater than 1/4 the width
    • the program then sets the image heights and widths appropriately and scales the image for best fit
    • I derived the equations in the program to be the easiest way to calculate the correct spacing and scaling the images need
    • if you wanted to play around with spacing, more math could be added, so variables like inner_gap, outer_gap, outer_vertical_gap could be defined programmatically, but deriving the equations leads to fewer calculations performed

fixes remaining

  • Adding a create_wallpaper() function to the main cli body, this would mirror the setup of the current implementation and clean up the main() function
  • fix some of the math, right now I have to recalculate the outer gaps after finding the best size for the images (horizontal_available_space, horizontal_outer_gap)
  • come up with a naming scheme for generated wallpapers
  • add documentation for features

Possible improvements

  • Input colors from the get_palette image method as suggestions for background color
  • Add an effect to the background color, a radial gradient could be a good choice to give it a little more life
  • change the spacing on the outer gaps. As you can see in the vertical wallpaper with a single poster, the gaps are a little too aggressive, and the poster could be slightly larger maybe? A matter of personal taste again but could be improved.

@youngbloodkyle youngbloodkyle marked this pull request as draft May 7, 2025 00:55
@ZIWAE
Copy link

ZIWAE commented Aug 5, 2025

i like posters without any shadow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants