Kamal578 / DSA2_BMP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bitmap Image Manipulation

This repository contains the code for a program that generates square images with symmetrical or asymmetrical patterns. The program is developed as part of the project for the course "Advanced Data Structures and Algorithms" at French-Azerbaijani University.

Introduction

Computer-generated images have become indispensable in today's digital era, finding applications in entertainment, advertising, and scientific visualization. Creating visually appealing and unique images is a crucial aspect of computer graphics and image processing. This project focuses on generating customized square images with symmetrical or asymmetrical patterns.

The goal is to develop a program that generates square images according to user-defined specifications, such as size, symmetry type, line thickness, and number of images. By leveraging image manipulation principles and randomization techniques, visually striking patterns can be created.

The project utilizes the BMP (Bitmap) file format, a widely adopted format for storing pixel data. By manipulating the pixel values, the program can generate a diverse range of shapes and patterns.

Structures and Definitions

The code includes several structures and definitions to support image generation. Notable ones are:

  • EDirectionsSymmetry: An enumeration defining the different directions of symmetry for the generated images.
  • bool: A boolean definition with two possible values, false and true.
  • SImageHeader: A structure representing the header of the image file, containing information such as the file type, size, image dimensions, color information, and additional metadata.
  • SImage: A structure representing the image itself, containing a pointer to the pixel data and the image header.

Methodology

The image generation methodology consists of several steps, including image header initialization, pixel generation, image creation, and image saving. The implementation follows a modular approach, with separate functions for each step.

For image generation, the program takes into account command-line arguments provided by the user, such as output file name, image size, symmetry type, and number of images. The program also supports an optional seed value for reproducibility of generated images.

Design and Implementation

The code is designed using a set of functions and data structures. The image generation functions are implemented in the image.c source file, including functions for image header initialization, pixel generation, image creation, and image saving.

The main program logic is implemented in the symasym.c source file. It handles the command-line arguments, generates the specified number of images, and saves them to BMP files.

Examples of Generated Images

The repository includes example images generated by the program. These images demonstrate the output when generating images with various symmetries and sizes.

Usage

To use the program, follow these steps:

  1. Clone the repository: git clone https://github.com/Kamal578/DSA2_BMP or download the source code.
  2. Compile the code: gcc symasym.c image.c -o symasym
  3. Run the program with desired command-line arguments: Example: ./symasym -o output -size 100 -sv -n 5

Conclusion

The image generation program provides a flexible and versatile tool for creating captivating visual patterns. With customizable options for size, symmetry type, and line thickness, users can explore and generate a wide range of unique images. The program's implementation utilizes image manipulation principles and leverages the BMP file format for compatibility and ease of use.


This project is developed by Ahmadov Kamal and Osmanli Ravan as part of the course "Advanced Data Structures and Algorithms" at French-Azerbaijani University.

For any questions or inquiries, please contact

P. S. the received grade was 16/20

About


Languages

Language:TeX 59.1%Language:C 38.3%Language:Shell 2.6%