{"id":19806657,"url":"https://github.com/timnew/pixel-blender","last_synced_at":"2026-07-14T19:32:58.710Z","repository":{"id":145702572,"uuid":"160939240","full_name":"timnew/pixel-blender","owner":"timnew","description":null,"archived":false,"fork":false,"pushed_at":"2018-12-08T13:50:20.000Z","size":2185,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T18:00:51.723Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/timnew.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}},"created_at":"2018-12-08T12:54:31.000Z","updated_at":"2021-03-20T04:57:31.000Z","dependencies_parsed_at":"2023-04-07T23:47:04.547Z","dependency_job_id":null,"html_url":"https://github.com/timnew/pixel-blender","commit_stats":{"total_commits":8,"total_committers":2,"mean_commits":4.0,"dds":0.375,"last_synced_commit":"5a46915397e525c9c6243ea25abb27dbb64a165a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/timnew/pixel-blender","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timnew%2Fpixel-blender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timnew%2Fpixel-blender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timnew%2Fpixel-blender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timnew%2Fpixel-blender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timnew","download_url":"https://codeload.github.com/timnew/pixel-blender/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timnew%2Fpixel-blender/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35476730,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-14T02:00:06.603Z","response_time":114,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-12T09:08:07.714Z","updated_at":"2026-07-14T19:32:58.684Z","avatar_url":"https://github.com/timnew.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pixel-blender\n\nI saw a magical image from a IM group chat:\n\n![OriginalImage][original]\n\nIt looks normal at by default, but when you open it to fullscreen, you got something different:\n\n![Original Image in full screen][original-black]\n\nAt beginning, I thought it was probably made with gif, which has 2 frames, and make the 2nd frame loop infinitely.\nSo in thumbnail you can only see the first frame as the animation is not running, and when you put it stucked into the 2nd frame.\n\nBut very soon, I realised that I'm wrong, as actually the animation is running even on thumbnail.\n\nThen I downloaded the image, and I got shocked again, as it actually works in photos app on my iPhone.\n\nAfter play with it a little bit, I realised how it actually works.\n\nThen I created this repo to reproduce what they made.\n\n## How to use it\n\nIt is a ruby script that blends two image together\n\n```\n# ./blend -timage1.png -fimage2.png\n Thumbnail Image: image1.png\nFullscreen Image: image2.png\n    Output Image: output.png\nLoading image1.png....\nLoaded: [752 x 1000]\nLoading image2.png....\nLoaded: [752 x 1000]\nPreparing canvas...\nCanvase: [752 x 1000]\nBlending pixels...\nSaving file output.png...\n```\n\nOutput file:\n![output.png][output]\n\nOutput file on black backgound\n![output.png on black background][output-black]\n\n## Limitation\n\nThe script will turn the image into black \u0026 white, as it is to guaranteed the blended image on black and white background.\n\n## How it works\n\nAlpha blending is to paint one opaque color with a certain transparency onto another opaque background color, and calculate the final opaque color.\n\nSo `FGColor * Alpha + BGColor = ActualColor`\n\nSo you actually can find out the `Alpha` by given `FGColor` `BGColor` and `ActualColor`.\n\nAnd normally, the IM chat app render the thumbnail with white background but the fullscreen with black background. And if the image is B\u0026W.\n\nNow you can turn your image into one with partially white color, so it renders on black background but is invisible on white background. \n\nOr you can turn your image into one with partial black color, so it renders on white background but is invisible on black background.\n\nThe interleave the 2 images into one by picking the pixel from one or another\n\n[original]: https://github.com/timnew/pixel-blender/raw/master/original.PNG\n[original-black]: https://github.com/timnew/pixel-blender/raw/master/original-blackbg.png\n[output]: https://github.com/timnew/pixel-blender/raw/master/output.png\n[output-black]: https://github.com/timnew/pixel-blender/raw/master/output-blackbg.png\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimnew%2Fpixel-blender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimnew%2Fpixel-blender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimnew%2Fpixel-blender/lists"}