{"id":31466948,"url":"https://github.com/59de44955ebd/pil-thumbnail-handler","last_synced_at":"2026-04-18T00:02:24.504Z","repository":{"id":316638836,"uuid":"1064152255","full_name":"59de44955ebd/PIL-Thumbnail-Handler","owner":"59de44955ebd","description":"Thumbnail Handler Windows Shell Extension for PIL image files","archived":false,"fork":false,"pushed_at":"2025-09-27T07:51:24.000Z","size":10202,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-04T06:47:51.716Z","etag":null,"topics":["image-files","pil","pillow","python","shell-extension","thumbnail-handler","windows"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/59de44955ebd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-25T16:03:50.000Z","updated_at":"2025-09-27T07:51:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"6b1dba4f-e57d-4fb6-b0c8-35057a82e689","html_url":"https://github.com/59de44955ebd/PIL-Thumbnail-Handler","commit_stats":null,"previous_names":["59de44955ebd/pil-thumbnail-handler"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/59de44955ebd/PIL-Thumbnail-Handler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/59de44955ebd%2FPIL-Thumbnail-Handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/59de44955ebd%2FPIL-Thumbnail-Handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/59de44955ebd%2FPIL-Thumbnail-Handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/59de44955ebd%2FPIL-Thumbnail-Handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/59de44955ebd","download_url":"https://codeload.github.com/59de44955ebd/PIL-Thumbnail-Handler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/59de44955ebd%2FPIL-Thumbnail-Handler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31950891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["image-files","pil","pillow","python","shell-extension","thumbnail-handler","windows"],"created_at":"2025-10-01T18:02:55.306Z","updated_at":"2026-04-18T00:02:24.492Z","avatar_url":"https://github.com/59de44955ebd.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## PIL Thumbnail Handler\r\n\r\n`PIL Thumbnail Handler` is a shell extension (.dll) for Windows 10/11 x64 that allows Explorer to show thumbnails for PIL image files (.pil). It's basically a fun project, and propably only useful for myself, since the \"PIL image file format\" is my own invention (see below).\r\n\r\nThe PIL image file format supports *any* image mode that [Pillow]() supports - that's the idea of the format, and the reason why it exists -, whereas the shell extension supports the following 15 modes:\r\n- CMYK (4 bytes per pixel)\r\n- RGBA (4 bytes per pixel)\r\n- RGB (3 bytes per pixel)\r\n- LA (L + alpha channel, so 2 bytes per pixel)\r\n- PA (P + alpha channel, so 2 bytes per pixel)\r\n- L (grayscale image, 1 byte per pixel)\r\n- P (palette based image, 1 byte per pixel)\r\n- P:4 (palette based image with at most 16 colors, 2 pixels stored in each byte)\r\n- P:2 (palette based image with at most 4 colors, 4 pixels stored in each byte)\r\n- P:1 (palette based image with 2 colors, 8 pixels stored in each byte)\r\n- 1 (black \u0026 white image, 8 pixels stored in each byte)\r\n- I (grayscale, 32-bit signed integer pixels, so 4 bytes per pixel)\r\n- F (grayscale, 32-bit floating point pixels, so 4 bytes per pixel)\r\n- HSV (3 bytes per pixel)\r\n- YCbCr (3 bytes per pixel)\r\n\r\n(Note: for Pillow P:1, P:2 and P:4 are actually rawmodes, not modes. The image\r\nplugin automatically loads and saves P or PA images with those rawmodes\r\nif the image's palette has at most 2 resp. 4 resp. 16 colors. The mode\r\nstring saved in the file is still just P resp. PA).\r\n\r\nThe PIL image file format supports DEFLATE compression of the image data, which is the same compression that PNG uses. Therefor a compressed RGB PIL file has roughly the same filesize as the same image stored as PNG.\r\n\r\n## Usage\r\n\r\nRun `register_run_as_admin.cmd` (in unpacked release) as admin to register the shell extension `PILThumbs.dll` in the system. If you now navigate to the `test_files` folder, Explorer should show thumbnails for all included .pil files.\r\n\r\nRun `unregister_run_as_admin.cmd` as admin to unregister the shell extension.\r\n\r\n## PilImagePlugin.py (Python)\r\n\r\n[PilImagePlugin.py](/PilImagePlugin.py) is a simple image plugin for [Pillow](https://pillow.readthedocs.io/en/stable/) that allows Pillow to read and write PIL image files, with any image mode that Pillow supports.\r\n\r\nUsage:\r\n```python\r\nfrom PIL import Image\r\nimport PilImagePlugin  # registers the plugin in Pillow\r\n\r\nimg = Image.open('CMYK.pil')\r\nimg.show()\r\n\r\n# Save as compressed grayscale image\r\nimg.convert('L').save('L.pil', compression=1)\r\n\r\n# Same as: img.convert('L').save('L.pil', compression=PilImagePlugin.Compression.DEFLATE)\r\n# DEFLATE compression is now the default, so also the same as:\r\n# img.convert('L').save('L.pil')\r\n# Use compression=0 or compression=PilImagePlugin.Compression.UNCOMPRESSED to save as \r\n# uncompressed image file.\r\n```\r\n\r\n## Screenshots                \r\n                              \r\n*Windows 11 Explorer showing thumbnails for all 15 supported image modes*     \r\n![](screenshots/modes.jpg)\r\n\r\n## PIL image file format\r\n\r\n\"PIL\" is a very simple (dummy) image file format that stores [Pillow's](https://pillow.readthedocs.io/en/stable/)\r\ninternally used image data - as returned by Image.tobytes() -\r\ndirectly in the file, optionally compressed with DEFLATE compression.\r\n\r\nIt therefor supports *any* image mode (not rawmode) that Pillow supports.\r\n\r\nIt adds a minimal file header to the data, and in case of mode\r\n\"P\" or \"PA\" also the palette colors and the index of a transparent\r\ncolor in the palette, if there is one.\r\n\r\nIt can optionally also store EXIF data at the very end of the file.\r\n\r\nThe purpose of this file format is not usage in real world applications,\r\nbut to simplify testing features in Pillow based applications. Since\r\nthe format can load and save any image mode, it makes testing image\r\noperations, filters, conversions etc. concerning supported modes a\r\nlittle easier. Pillow comes with an obscure file format called IM -\r\nI guess mainly for the very same purpose - that also supports most image modes,\r\nbut not all of them.\r\n\r\n**Note**: this PIL file format is not affiliated with the PIL/Pillow project/dev\r\nteam in any way, I called it \"PIL\" because a) it is based on PIL/Pillow's\r\nimage modes and internal data layout, and b) because the file extension\r\n*.pil was still available, i.e. not used by any common file format yet.\r\n\r\n### File structure\r\n\r\n```\r\n                            (4 bytes per row)\r\n\r\n|        P        |        L        |       \\0        |  \u003ccompression\u003e  |\r\n|      \u003cwidth\u003e (unsigned short)     |     \u003cheight\u003e (unsigned short)     |\r\n|       \u003cmode\u003e (PIL Image.mode as 4 chars, right padded with \\0)        |\r\n\r\n\r\nOnly if mode is \"P\" or \"PA\":\r\n|  \u003cpalette size\u003e (unsigned short)  |      \u003ctr\u003e       |   \u003ctr index\u003e    |\r\n|                 \u003cpalette data\u003e (3 bytes per color, RGB)               |\r\n|                                ...                                    |\r\n\r\n\r\n|                  \u003cimage data size\u003e (unsigned long)                    |\r\n|               \u003cimage data\u003e (compressed or uncompressed)               |\r\n|                                ...                                    |\r\n\r\nEither:\r\n|                               0000 (=EOF marker)                      |\r\nOr:\r\n|                    \u003cEXIF data\u003e (starting with \"Exif\")                 |\r\n|                                ...                                    |\r\n\r\n\r\n\u003ccompression\u003e: \\0 = uncompressed, \\1 = DEFLATE \r\n    (other compression schemes like e.g. RLE, LZW or LZMA could be added)\r\n\u003ctr\u003e: Transparency? \\0 = no, \\1 = yes\r\n\u003ctr index\u003e: Index of transparent color in palette (if \u003ctr\u003e is \\1)\r\n```\r\n\r\n## Compiling\r\n\r\nCompiling the shell extension requires MS Visual Studio 2017 or later.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F59de44955ebd%2Fpil-thumbnail-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F59de44955ebd%2Fpil-thumbnail-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F59de44955ebd%2Fpil-thumbnail-handler/lists"}