{"id":20349571,"url":"https://github.com/thehemen/pixelated-morphing","last_synced_at":"2026-04-20T19:31:56.281Z","repository":{"id":198202904,"uuid":"700299471","full_name":"thehemen/pixelated-morphing","owner":"thehemen","description":"Generation of different pixelated character images.","archived":false,"fork":false,"pushed_at":"2024-10-30T17:02:00.000Z","size":29877,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T18:08:00.030Z","etag":null,"topics":["game-art","morphing","opencv","pixel-art","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thehemen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-10-04T10:31:48.000Z","updated_at":"2025-01-05T08:51:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"32c91f3d-1260-48d8-8c32-b5c3643ac06d","html_url":"https://github.com/thehemen/pixelated-morphing","commit_stats":null,"previous_names":["thehemen/pixelated-morphing"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thehemen/pixelated-morphing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehemen%2Fpixelated-morphing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehemen%2Fpixelated-morphing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehemen%2Fpixelated-morphing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehemen%2Fpixelated-morphing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thehemen","download_url":"https://codeload.github.com/thehemen/pixelated-morphing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehemen%2Fpixelated-morphing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32062312,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"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":["game-art","morphing","opencv","pixel-art","python"],"created_at":"2024-11-14T22:26:31.848Z","updated_at":"2026-04-20T19:31:56.264Z","avatar_url":"https://github.com/thehemen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pixelated Morphing\n\nThis code allows you to create different pixelated character images by using the morphing algorithm.\nA visual description of the process is described on [Medium](https://medium.com/@thehemen/generative-art-of-pixelated-characters-tips-and-practices-69f38b63e49c).\n\nThe generation by the DCGAN model is available as well.\nA description of the process is presented on [Medium](https://medium.com/@thehemen/generative-art-of-pixelated-characters-usage-of-dcgan-model-f6682a6decff).\n\n## How to Generate Images\n\nAs a baseline, a set of 100 images similar to [Minecraft's ones](https://minecraft.fandom.com/wiki/Minecraft_Wiki) are used.\n\nTo run this algorithm, you need to install requirements:\n\n```sh\npip install -r requirements.txt\n```\n\nFirst, you need to get aligned versions of initial images:\n\n```sh\npython3 add_aligned_imgs.py\n```\n\nSecond, you need to label these images by [Computer Vision Annotation Tool](https://github.com/opencv/cvat), then save them in [COCO](https://cocodataset.org/) format.\n\nAfter that, you should extract the annotations of the resulting images:\n\n```sh\npython3 extract_labels.py\n```\n\nAlso, the categories of these images should be mentioned in categories.json.\n\nYou may see some missing areas in images. You can fill them with the help of any graphic editor (for example, [GIMP](https://www.gimp.org/)).\n\nThen, you can visualize an image:\n\n```sh\npython3 show_img.py --name [character name]\n```\n\nTo upscale/downscale an image, use Up/Down key arrows.\n\nFinally, you can generate new images (that will be saved in characters.zip):\n\n```sh\npython3 generate_images.py --n [image_number] \\\n--recolor_value [recoloring probability] \\\n--change_style_value [style changing probability] \\\n--alpha [alpha value of beta distribution] \\\n--beta [beta value of beta distribution] \\\n--width [align width] \\\n--upscale_num [image zoom number] \\\n--n_jobs [number of parallel processes] \\\n--pixelate [use pixelation]\n```\n\nSo, the work is done.\n\n## How to Visualize Images\n\nThere are few additional scripts that allow you to check out the different aspects of the algorithm.\n\nFor instance, if you've generated images with the `--pixelate` option turned on, you can upscale them by using this command:\n\n```sh\npython3 unpixelate_images.py \\\n--input [initial image folder] \\\n--output [unpixelated image folder] \\\n--width [align width]\n```\n\nTo visualize the image recoloring by its [HCL](https://hclwizard.org/) color channels, you can use this [DearPyGUI](https://github.com/hoffstadt/DearPyGui) based application:\n\n```sh\npython3 show_recoloring.py --name [character name]\n```\n\nTo see, how an image's style transfer is applied, run this one:\n\n```sh\npython3 show_style_transfer.py \\\n--first [character name for which the style is transferred] \\\n--second [character name from which the style is transferred] \\\n--width [align width]\n```\n\nFinally, you can run this script to visualize the morphing process with recoloring and swap style effects:\n\n```sh\npython3 show_morphing.py \\\n--first [the first character name] \\\n--second [the second character name] \\\n--recoloring [use recoloring] \\\n--swap_styles [use swap styles] \\\n--frame_num [number of frames] \\\n--delay [delay between frames in ms] \\\n--width [align width]\n```\n\n## How to Train DCGAN Model\n\nIn addition to the morphing algorithm, the neural network's generation is added.\n\nTo train a DCGAN model, run this command:\n\n```sh\npython3 train_dcgan.py \\\n--n [number of images] \\\n--seed [seed value] \\\n--batch_size [size of the batch] \\\n--num_epochs [number of epochs] \\\n--checkpoint_epoch [number of epochs when the model is saved] \\\n--img_epoch [number of epochs when the image is saved] \\\n--change_image_num [number of image history epochs] \\\n--change_image_value [probability of image change] \\\n--noise_value [max value of noise added to labels] \\\n--workers [number of parallel processes] \\\n--gpu [use the GPU device]\n```\n\n## How to Test DCGAN model\n\nTo test a DCGAN model, run this command:\n\n```sh\npython3 test_dcgan.py \\\n--model_name [filename of the model] \\\n--seed_first [first image seed value] \\\n--seed_second [second image seed value] \\\n--width [width to align] \\\n--frame_num [number of frames] \\\n--delay [delay between frames in ms] \\\n--gpu [use the GPU device] \\\n--image [use the single image]\n```\n\nGood luck!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthehemen%2Fpixelated-morphing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthehemen%2Fpixelated-morphing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthehemen%2Fpixelated-morphing/lists"}