Skip to content

Python Camouflage Pattern Generator, GUI available

Notifications You must be signed in to change notification settings

Minhtrna/Pycamo

Repository files navigation

Camouflage Pattern Generator

Camouflage Pattern Generator


Table of Contents

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

Update

Pycamo can generate pixel camo now! Check the box if u want, also i rewrite file save function and Camo generate algorithm too it better now. ENJOY!!

image


How It Works?

This camouflage pattern generator is based on fractal noise.

1. Extract Colors

The first step is extract 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

Pycamo can generate 2 type of digital camo: Fractal and pixel.

Camouflage Pattern Generator

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=[] Passes the predefined ratios for each color to the generate_pattern function.
pixelize=True/False Set True to pixelize camo, False for normal fractal.
"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.

go to GUI folder

then

python GUI.py

ENJOY!

image