enh: image compression #2615

Closed
opened 2025-11-11 15:10:43 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @somnifex on GitHub (Nov 11, 2024).

Originally assigned to: @tjbck on GitHub.

When we take pictures with modern phones or cameras, the image pixels and size are huge. The size of images passed into the API may be several MB or even tens of MB, which can be a disaster for some small VLM (perhaps it's also a disaster for large VLM, as there is too much redundant information in the picture). Can we provide an upfront image processing step to compress the image before passing it to the LLM API according to user settings, reducing its size to KB? (of course, users can also choose not to compress it, lol)

Originally created by @somnifex on GitHub (Nov 11, 2024). Originally assigned to: @tjbck on GitHub. When we take pictures with modern phones or cameras, the image pixels and size are huge. The size of images passed into the API may be several MB or even tens of MB, which can be a disaster for some small VLM (perhaps it's also a disaster for large VLM, as there is too much redundant information in the picture). Can we provide an upfront image processing step to compress the image before passing it to the LLM API according to user settings, reducing its size to KB? (of course, users can also choose not to compress it, lol)
Author
Owner

@parniantaghipour commented on GitHub (Nov 11, 2024):

@tjbck Do you think this is helpful?

https://openwebui.com/f/lamkhatinh/image_resizer

@parniantaghipour commented on GitHub (Nov 11, 2024): @tjbck Do you think this is helpful? https://openwebui.com/f/lamkhatinh/image_resizer
Author
Owner

@Fusseldieb commented on GitHub (Dec 2, 2024):

@tjbck Do you think this is helpful?

https://openwebui.com/f/lamkhatinh/image_resizer

This resizes it on the server, solving only part of the problem. Uploading a 5MB file using 4G on a phone still takes a decent amount of time. The solution is client-side resizing/compression.

@Fusseldieb commented on GitHub (Dec 2, 2024): > @tjbck Do you think this is helpful? > > https://openwebui.com/f/lamkhatinh/image_resizer This resizes it on the server, solving only part of the problem. Uploading a 5MB file using 4G on a phone still takes a decent amount of time. The solution is client-side resizing/compression.
Author
Owner

@123hi123 commented on GitHub (Dec 2, 2024):

is this already sppourt by the newest version?

@123hi123 commented on GitHub (Dec 2, 2024): is this already sppourt by the newest version?
Author
Owner

@spammenotinoz commented on GitHub (Dec 2, 2024):

is this already sppourt by the newest version?

The function is already supported but you need to download and install it.
I am finding it works as intended. I am not personally impacted by the slow uploads, so this function fixed my issues, especially with Anthropic.

@spammenotinoz commented on GitHub (Dec 2, 2024): > is this already sppourt by the newest version? The function is already supported but you need to download and install it. I am finding it works as intended. I am not personally impacted by the slow uploads, so this function fixed my issues, especially with Anthropic.
Author
Owner

@123hi123 commented on GitHub (Dec 3, 2024):

is this already sppourt by the newest version?這是否已由最新版本支援?

The function is already supported but you need to download and install it.該功能已受支援,但您需要下載並安裝它。 I am finding it works as intended. I am not personally impacted by the slow uploads, so this function fixed my issues, especially with Anthropic.我發現它按預期工作。我個人沒有受到上傳速度慢的影響,所以這個功能解決了我的問題,特別是與 Anthropic 有關的問題。

you say download this? https://openwebui.com/f/lamkhatinh/image_resizer
I thought this feature was included in the latest version.

@123hi123 commented on GitHub (Dec 3, 2024): > > is this already sppourt by the newest version?這是否已由最新版本支援? > > The function is already supported but you need to download and install it.該功能已受支援,但您需要下載並安裝它。 I am finding it works as intended. I am not personally impacted by the slow uploads, so this function fixed my issues, especially with Anthropic.我發現它按預期工作。我個人沒有受到上傳速度慢的影響,所以這個功能解決了我的問題,特別是與 Anthropic 有關的問題。 you say download this? https://openwebui.com/f/lamkhatinh/image_resizer I thought this feature was included in the latest version.
Author
Owner

@tjbck commented on GitHub (Dec 25, 2024):

image

Added to dev!

@tjbck commented on GitHub (Dec 25, 2024): <img width="914" alt="image" src="https://github.com/user-attachments/assets/34c1f94e-6b6e-4113-9819-998d30ecac6d" /> Added to dev!
Author
Owner

@Fusseldieb commented on GitHub (Dec 25, 2024):

@tjbck Does this resize on the server or on the device?

@Fusseldieb commented on GitHub (Dec 25, 2024): @tjbck Does this resize on the server or on the device?
Author
Owner

@tjbck commented on GitHub (Dec 25, 2024):

You should be using filter functions for server-side compression, above is for client-side.

@tjbck commented on GitHub (Dec 25, 2024): You should be using filter functions for server-side compression, above is for client-side.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#2615