如何使用枕头库使用抖动?

发布于 2025-02-13 02:14:22 字数 805 浏览 0 评论 0原文

我想从枕头上使用抖动,( https://pillow.readthedocs.io/en/stable/reference/image.html#pil.image.image.image.dither.fither.floydsteinberg

我的问题是如何从枕头上导入抖动,

遵循我的代码,是我的代码,是我的代码,

import os

from PIL import Image



ORIGIN_PATH = "/home/prajakta/Tasks/Evaluate detection model on scanned customer documents/scanned_docs/"
#DESTIN_PATH = "/home/prajakta/Tasks/Evaluate detection model on scanned customer documents/scanned_docs_grayscale/"


for filename in os.listdir(ORIGIN_PATH):
    img = Image.open(ORIGIN_PATH + filename).convert("L", dither=Image.Dither)
    img.show()

先感谢您。

I want to use Dithering from pillow, (https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Dither.FLOYDSTEINBERG)

My question is how to import dither from pillow,

Following is my code,

import os

from PIL import Image



ORIGIN_PATH = "/home/prajakta/Tasks/Evaluate detection model on scanned customer documents/scanned_docs/"
#DESTIN_PATH = "/home/prajakta/Tasks/Evaluate detection model on scanned customer documents/scanned_docs_grayscale/"


for filename in os.listdir(ORIGIN_PATH):
    img = Image.open(ORIGIN_PATH + filename).convert("L", dither=Image.Dither)
    img.show()

Thank you in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文