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 option to set image format in component #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

breengles
Copy link

@breengles breengles commented May 20, 2024

Currently, images saved from the ImageSlider component are in webp format. This PR adds option to override this by setting image_format property with default value matching previous webp format.

As a workaround, you can pre-save images in the desired format and send them to slider as filepaths:

silder = ImageSlider(..., type="filepath")

and then smth like that

from PIL import Image

def process(...):
    ...
    left_image: Image.Image
    right_image: Image.Image

    left_image_path = "some/path/to/left_image.png"
    right_image_path = "some/path/to/right_image.png"
    left_image.save(left_image_path)
    right_image.save(right_image_path)
    return (left_image_path, right_image_path)

@deltheil
Copy link

deltheil commented Sep 4, 2024

@pngwn what's your take on this? (would be useful IMHO)

@ZhengPeng7
Copy link

It's very useful, and there've been some people asking me for this. Could the author add this option? Many thanks!@pngwn

@breengles
Copy link
Author

FIY: if you need specific format in output you can pass in paths to images - then they will be available in slider in their respected extensions

@ZhengPeng7
Copy link

Yeah, thanks. I know what you mean, and it can be done that way. However, it needs to change many existing codes, so I still hope the author can update this function.

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.

3 participants