{"id":16272136,"url":"https://github.com/progamergov/neural-tools","last_synced_at":"2026-03-01T03:32:27.909Z","repository":{"id":57445775,"uuid":"82333291","full_name":"ProGamerGov/Neural-Tools","owner":"ProGamerGov","description":"Tools made for usage alongside artistic style transfer projects","archived":false,"fork":false,"pushed_at":"2019-11-22T15:14:58.000Z","size":84,"stargazers_count":188,"open_issues_count":1,"forks_count":30,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-09T22:17:01.927Z","etag":null,"topics":["coarse","color","color-transfer","controlling","factors","fine","grayscale-images","linear-color-transfer","luminance","luminance-transfer","neural","neural-style","neural-style-pt","perceptual","scale","scale-control","style","style-transfer","tools","transfer"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/ProGamerGov.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}},"created_at":"2017-02-17T20:00:13.000Z","updated_at":"2025-03-27T03:18:51.000Z","dependencies_parsed_at":"2022-09-26T17:30:17.722Z","dependency_job_id":null,"html_url":"https://github.com/ProGamerGov/Neural-Tools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProGamerGov%2FNeural-Tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProGamerGov%2FNeural-Tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProGamerGov%2FNeural-Tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProGamerGov%2FNeural-Tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ProGamerGov","download_url":"https://codeload.github.com/ProGamerGov/Neural-Tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119287,"owners_count":21050755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["coarse","color","color-transfer","controlling","factors","fine","grayscale-images","linear-color-transfer","luminance","luminance-transfer","neural","neural-style","neural-style-pt","perceptual","scale","scale-control","style","style-transfer","tools","transfer"],"created_at":"2024-10-10T18:16:23.321Z","updated_at":"2026-03-01T03:32:27.833Z","avatar_url":"https://github.com/ProGamerGov.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Neural-Tools\nTools made for usage alongside artistic style transfer projects based on the [Controlling Perceptual Factors in Neural Style Transfer](https://arxiv.org/abs/1611.07865) research paper by Leon A. Gatys, Alexander S. Ecker, Matthias Bethge, Aaron Hertzmann, and Eli Shechtman.\n\n**In-depth information about how to perform Scale Control and Color Control, including the Neural-Style parameters used in the examples, can be found on the [wiki](https://github.com/ProGamerGov/Neural-Tools/wiki).** The Color Control feature is broken down into two different features known as Luminance-Only Style Transfer, and Color Matching. The Scale Control feature focuses on separating style image content/shapes, and style image textures. \n\n# Linear Color Transfer\n\nThe `match_color` function's code comes from the very talented Leon Gatys' code [here](https://github.com/leongatys/NeuralImageSynthesis/blob/master/ExampleNotebooks/ScaleControl.ipynb). This script was developed to help enable Scale Control in [Neural-Style](https://github.com/jcjohnson/neural-style), but it can be used for anything else that requires linear color transfer. Supported image formats include: `jpg`, `jpeg`, `png`, `tiff`, etc...\n\nScale Control examples made with [Neural-Style](https://github.com/jcjohnson/neural-style), can be viewed [here](https://github.com/ProGamerGov/Neural-Tools/wiki/Scale-Control-Examples).\n\n### Dependencies: \n\n`sudo pip install scikit-image`\n\n`sudo pip install imageio`\n\n`sudo pip install numpy`\n\n`sudo pip install scipy`\n\n### Usage: \n\nBasic usage: \n\n```\npython linear-color-transfer.py --target_image target.png --source_image source.png\n```\n\nAdvanced usage: \n\n```\npython linear-color-transfer.py --target_image target.png --source_image source.png --output_image output.png --mode pca --eps 1e-5\n```\n\n### Parameters: \n\n* `--target_image`: The image you are transfering color to. Ex: `target.png`\n\n* `--source_image`: The image you are transfering color from. Ex: `source.png`\n\n* `--output_image`: The name of your output image. Ex: `output.png`\n\n* `--mode`: The color transfer mode. Options are `pca`, `chol`, or `sym`.\n\n* `--eps`: Your epsilon value in scientific notation or normal notation. Ex: `1e-5` or `0.00001`.\n\n### Examples: \n\n**Source Image:** \n\n![](https://i.imgur.com/eoX7f3Il.jpg)\n\n**Target Image:** \n\n![](https://i.imgur.com/7FPCSril.jpg)\n\n**Output Image:** \n\n![](https://i.imgur.com/STZ0Mspl.png)\n\n**[See here for how to use this script for Scale Control](https://github.com/ProGamerGov/Neural-Tools/wiki/Scale-Control-Examples)**.\n\n![](https://i.imgur.com/fsqGmJfl.png)\n\n\n### Linear Color Transfer is also used for Color Matching Style Transfer:\n\n![](https://i.imgur.com/6xf5c9yl.jpg)\n\n\nSee [here on the wiki](https://github.com/ProGamerGov/Neural-Tools/wiki/Color-Matching), for more details on Color Matching Style Transfer.\n\n---\n\n---\n\n# Luminance Transfer\n\nThis script was developed to help enable colour control in [Neural-Style](https://github.com/jcjohnson/neural-style), also known as \"Luminance Transfer\". This script uses code from Leon Gatys' code [here](https://github.com/leongatys/NeuralImageSynthesis/blob/master/ExampleNotebooks/ColourControl.ipynb). Supported image formats include: `jpg`, `jpeg`, `png`, `tiff`, etc...\n\nLuminance transfer/Color Control examples made with [Neural-Style](https://github.com/jcjohnson/neural-style), can be found [here](https://github.com/ProGamerGov/Neural-Tools/wiki/Color-Control-Examples).\n\n### How It Works: \n\nCurrently, all available models are trained on images with the RGB/BGR color space. An image's luminance can represented in the form of gray scale color space image, which can be converted to RGB format for Neural-Style. After the gray scale images are run through Neural-Style, re-applying the color to your output is done with the use of the LUV color space.\n\nBasically due to pre-trained model limitations, gray scale images are used to transfer luminance, and a color space supporting luminance is used to transfer the colors back to the finished output. \n\n### Dependencies: \n\n`sudo pip install scikit-image`\n\n`sudo pip install imageio`\n\n`sudo pip install numpy`\n\n`sudo pip install scipy`\n\n### Usage:\n\nBasic usage: \n\n```\npython lum-transfer.py --content_image content.png --style_image style.png\n```\n\nAdvanced usage: \n\n```\npython lum-transfer.py --cp_mode lum --content_image content.png --style_image style.png --org_content content.png --output_style_image output_style.png --output_content_image output_content.png\n```\n\n### Parameters: \n\nThe required input images and the output images, are dependent on the `--cp_mode` option that you choose: \n\n* `--cp_mode`: The script's mode. Options are `lum`, `lum2`, `match`, `match_style`.\n\n\n**Mode: `lum`**\n\n\n* `--content_image`: Your content image. Ex: `content.png`\n\n* `--style_image`: Your style image. Ex: `style.png`\n\n* `--org_content`: Your original unmodified content image. Ex: `original_content.png`\n\n* `--output_content_image`: The name of your output content image. Ex: `content_output.png`\n\n* `--output_style_image`: The name of your output style image. Ex: `style_output.png`\n\n**Mode: `match`**\n\n* `--content_image`: Your content image. Ex: `content.png`\n\n* `--style_image`: Your style image. Ex: `style.png`\n\n* `--output_style_image`: The name of your output style image. Ex: `style_output.png`\n\n**Mode: `match_style`**\n\n* `--content_image`: Your content image. Ex: `content.png`\n\n* `--style_image`: Your style image. Ex: `style.png`\n\n* `--output_content_image`: The name of your output content image. Ex: `content_output.png`\n\n**Mode: `lum2`**\n\n* `--output_lum2`: The name of your output image from Neural-Style. Ex: `out.png`\n\n* `--org_content`: Your original unmodified content image. Ex: `original_content.png`\n\n* `--output_image`: The name of your output image. Ex: `output.png`\n\n### Examples:\n\n**The style image is adjusted to match the content image:**\n\n![](https://i.imgur.com/Q7phTmel.png)\n\n![](https://i.imgur.com/dRf3yZHl.png)\n\n**After Neural-Style:**\n\n![](https://i.imgur.com/hpW8zufl.png)\n\n**Final ouput image:** \n\n![](https://i.imgur.com/o5HDDtDl.png)\n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogamergov%2Fneural-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprogamergov%2Fneural-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogamergov%2Fneural-tools/lists"}