Skip to content

Python Camouflage Pattern Generator, GUI available

Notifications You must be signed in to change notification settings

Minhtrna/Pycamo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Camouflage Pattern Generator

Camouflage Pattern Generator


Table of Contents

  1. Update
  2. How It Works?
  3. How to Use

Update

Now you can use Pycamo with a GUI!. Just run GUI.py and enjoy.

Update Screenshot


How It Works?

This camouflage pattern generator is based on fractal noise. Below is an overview of its working process:

1. Extract Colors

The first step involves extracting the main colors from an input image.

Extract Colors

You can customize the number of colors to extract by modifying the num_colors parameter. For example:

color_palette = cp.extract_palette("demo_input/k20r.jpg", num_colors=4)  # Extract 4 main colors

2. Generate Fractal Noise

In this step, fractals are randomly generated within a given frame size and filled with the extracted colors. You can control the parameters to customize the final camouflage pattern.

Example:

generate_pattern(color_palette, "gencamo.png", size=(500, 500), c=3)

image

How to Use

Follow these steps to use the Camouflage Pattern Generator:

1. Clone the Project Repository

git clone https://github.com/Minhtrna/Pycamo.git

Install library

pip install -r requirements.txt

Then you can run Camogen

python camogen.py

You can edit parameter here

image

Parameter Description
color_palette A list of colors extracted from an image or defined manually.
num_colors The number of colors to extract from the image using the extract_palette function.
ratios A list of percentages defining how much each color should contribute to the pattern.
size The dimensions of the generated camouflage pattern in pixels (width, height).
c A parameter that controls the complexity of the fractal noise.
ratios=ratios Passes the predefined ratios for each color to the generate_pattern function.
"demo_input/teste3.png" The input image file used to extract colors.
"gencamo.png" The output file name where the generated pattern will be saved.

To use GUI instead of command.

cd to GUI folder

then

python GUI.py

ENJOY!

Update Screenshot