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 more options for the background #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Phoenix616
Copy link

This adds more options to specify both the background color as well as an image as the background. Also additionally the ability to set the opacity of the bars.

Options added:

  -o OPACITY            The opacity of the waveform on the background.
  -b COLOR              Set background color. Default is black.
  -i IMAGE              Set background image.
  -C COORDS             Set the center of the bars relative to the image if used.

@godomac
Copy link

godomac commented Oct 2, 2023

It would be awesome to have the background color of the video transparent. Is this possible?

@Phoenix616
Copy link
Author

@godomac mp4 does not support transparent background colors. That would require a different raw video format like AVI or QuickTime (.mov). I suggest opening a feature request, that's way out of scope of this PR.

seewav.py Outdated Show resolved Hide resolved
@@ -130,17 +147,18 @@ def draw_env(envs, out, fg_colors, bg_color, size):
pad = pad_ratio * width
delta = 2 * pad + width

ctx.translate(*offset)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need this offset here ?

seewav.py Outdated Show resolved Hide resolved
image = image.resize(image.width + 1, image.height)
if image.height % 2 is 1:
image = image.resize(image.width, image.height + 1)
output_size = image.width, image.height
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we should replace the output size with tjhe image size, maybe we should rather keep the video width and height controlled by the params, and resize the image given as background ? or maybe add a flag --use_background_image_size

Passing image size as tuple & fixing SyntaxWarning on literal identity check
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

Successfully merging this pull request may close these issues.

4 participants