Skip to content

Color Control Examples

ProGamerGov edited this page Feb 21, 2017 · 9 revisions

Color Control


Images used:

https://github.com/leongatys/NeuralImageSynthesis/blob/master/Images/ControlPaper/fig3_style1.jpg

https://github.com/leongatys/NeuralImageSynthesis/blob/master/Images/ControlPaper/fig3_content.jpg


The style image is adjusted to match the content image:

After Neural-Style:

The final output:


The process only takes 4 commands (including neural_style.lua) to complete:


Step 0 (Optional Depending On Your Content/Style Image):

python linear-color-transfer.py --target_image fig3_style1.jpg --source_image fig3_content.jpg --output_image style_colored_pca.png

Step 1:

python lum-transfer.py --content_image fig3_content.jpg --style_image style_colored_pca.png --cp_mode lum --output_style_image output_lum_style_pca.png --output_content_image output_lum_content_pca.png --org_content fig3_content.jpg 

Step 2:

th neural_style.lua -original_colors 0 -image_size 1000 -content_weight 1 -style_weight 1e3 -output_image out_lum6_test.png -content_image output_lum_content_pca.png -style_image output_lum_style_pca.png -num_iterations 1500 -save_iter 50 -print_iter 50 -seed 876 -init image -backend cudnn -cudnn_autotune

Step 3:

python lum-transfer.py --output_lum2 out_lum6_test_400.png --cp_mode lum2 --output_image out_combined.png --org_content fig3_content.jpg

Step 4 (Optional):

python linear-color-transfer.py --target_image out_combined.png --source_image fig3_content.jpg --output_image out_combined_pca.png