{"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fbaba-s.hatenablog.com%2Fentry%2F2022%2F05%2F20%2F081100\" title=\"\u3010Python\u3011\u6307\u5b9a\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u3059\u3079\u3066\u306e .png \u306e\u30e2\u30fc\u30c9\u3092 RGB \u304b\u3089\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u5909\u66f4\u3057\u3066\u80cc\u666f\u8272\u306f\u30d4\u30f3\u30af\u306b\u3059\u308b\u30b5\u30f3\u30d7\u30eb - \u30b3\u30ac\u30cd\u30d6\u30ed\u30b0\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","type":"rich","version":"1.0","categories":["\u305d\u306e\u4ed6","\u305d\u306e\u4ed6 - Python"],"width":"100%","published":"2022-05-20 08:11:00","provider_name":"Hatena Blog","blog_title":"\u30b3\u30ac\u30cd\u30d6\u30ed\u30b0","provider_url":"https://hatena.blog","blog_url":"https://baba-s.hatenablog.com/","description":"\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9 import glob from PIL import Image directory_path = \"\u3010\u30d5\u30a9\u30eb\u30c0\u306e\u30d1\u30b9\u3011/**/*.png\" files = glob.glob(directory_path, recursive=True) for path in files: image = Image.open(path) image = image.convert(\"P\") palette = image.getpalette() palette[255 * 3 + 0] = 255 palette[255 * 3 + 1] = 0 palette[255 * 3 + 2\u2026","title":"\u3010Python\u3011\u6307\u5b9a\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u3059\u3079\u3066\u306e .png \u306e\u30e2\u30fc\u30c9\u3092 RGB \u304b\u3089\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u5909\u66f4\u3057\u3066\u80cc\u666f\u8272\u306f\u30d4\u30f3\u30af\u306b\u3059\u308b\u30b5\u30f3\u30d7\u30eb","url":"https://baba-s.hatenablog.com/entry/2022/05/20/081100","author_name":"baba_s","height":"190","image_url":"https://cdn-ak.f.st-hatena.com/images/fotolife/b/baba_s/20220520/20220520134125.png","author_url":"https://blog.hatena.ne.jp/baba_s/"}