-
Notifications
You must be signed in to change notification settings - Fork 468
Open
Labels
component:apiIssues related to the API, not the SDK.Issues related to the API, not the SDK.status:triagedIssue/PR triaged to the corresponding sub-teamIssue/PR triaged to the corresponding sub-teamtype:bugSomething isn't workingSomething isn't working
Description
Description of the bug:
My code is
> if imageext.upper() == ".PNG":
> print("Make blank")
> rez_img = rez_img.convert("RGBA")
> print(rez_img.mode)
> resize_img_path = os.path.join(save_path,"rez_" + os.path.basename(img_path))
> rez_img.save(resize_img_path)
> rez_img = pilimg.open(img_path)
> print(getattr(rez_img, "get_format_mimetype", None))
> model_use = genai.GenerativeModel(model_name=model)
> try:
> response = model_use.generate_content([system_prompt, rez_img], safety_settings=safety_settings)
> response_text = str(response.text)
> except Exception as e:
> response_text = str(f"{e}")
and here is the output/
`
Make blank
RGBA
<bound method ImageFile.get_format_mimetype of <PIL.PngImagePlugin.PngImageFile image mode=RGBA size=3375x1894 at 0x1A0F83C6E80>>
From this link, It should upload from generate_content as PNG and transparency mode.
as show in #523 but when I got the output of "describe the image", I found the word, "on black background" which is mean the PNG with RGBA was convert to RGB.
Actual vs expected behavior:
expect to upload as PNG with RGBA.
but actual still RGB.
Any other information you'd like to share?
google-generativeai 0.8.1
ByeIO may not able to decode the alpha channel of an image.
I attached this in the code review.
and Here is from stackoverflow.
Metadata
Metadata
Assignees
Labels
component:apiIssues related to the API, not the SDK.Issues related to the API, not the SDK.status:triagedIssue/PR triaged to the corresponding sub-teamIssue/PR triaged to the corresponding sub-teamtype:bugSomething isn't workingSomething isn't working