Awesome evo_django_kits created by maycuatroi


License
Apache-2.0
Install
pip install evo-django-kits==0.1.1

Documentation

evo_django_kits

CI PyPI version PyPI - Downloads PyPI - Python Version PyPI - License GitHub issues

Awesome evo_django_kits created by maycuatroi

Install it from PyPI

pip install evo-django-kits

Usage

from evo_django_kits import BaseClass
from evo_django_kits import base_function

BaseClass().base_method()
base_function()
$ python -m evo_django_kits
#or
$ evo_django_kits

Development

Read the CONTRIBUTING.md file.

PNG Data Extractor

This repository contains tools to extract and analyze data from PNG files, with special focus on extracting C2PA (Content Authenticity Initiative) metadata that may be embedded in images generated by AI systems like ChatGPT.

Background

PNG files contain structured data in "chunks". In addition to standard PNG chunks, some AI-generated images contain C2PA metadata which provides provenance information. This metadata is often stored in text chunks (tEXt or iTXt) or in JUMBF (JPEG Universal Metadata Box Format) containers.

Tools Included

This repository includes several Python scripts for analyzing PNG files:

  1. png_data_extractor.py - Extracts standard PNG chunks and basic metadata
  2. c2pa_extractor.py - Focuses on extracting C2PA/CAI specific metadata
  3. extract_binary_data.py - Analyzes binary patterns looking for JUMBF boxes and signature patterns
  4. analyze_png.py - Combined tool that uses all three approaches

Requirements

  • Python 3.6+
  • No external dependencies (only standard library modules)

Usage

Analyze a PNG file with all tools at once:

python analyze_png.py path/to/your/image.png

This will generate several JSON files with analysis results:

  • image.png_analysis.json - Standard PNG chunk analysis
  • image.png_c2pa.json - C2PA metadata analysis
  • image.png_binary.json - Binary pattern analysis
  • image.png_combined.json - Combined analysis

Save output to a specific directory:

python analyze_png.py path/to/your/image.png -o output_directory

Print only a summary without saving files:

python analyze_png.py path/to/your/image.png -s

Using individual tools:

You can also use each tool separately:

python png_data_extractor.py path/to/your/image.png
python c2pa_extractor.py path/to/your/image.png
python extract_binary_data.py path/to/your/image.png

What Data Is Extracted

These tools extract:

  1. Standard PNG Information

    • All PNG chunks with their types, lengths, and data
    • Basic image information (dimensions, color type, bit depth)
    • Contents of text chunks
  2. C2PA/CAI Metadata

    • Claim generators and assertions
    • AI model information
    • Digital source type
    • URNs and other identifier information
    • Signature data
  3. Binary Analysis

    • JUMBF box structures
    • Content provenance signatures
    • ASCII strings related to C2PA/CAI

Example Output

The summary output looks like:

============================================================
PNG ANALYSIS SUMMARY FOR: example.png
============================================================

File size: 12345 bytes

PNG Chunks: 8
  - IHDR: 1
  - tEXt: 2
  - iTXt: 1
  - IDAT: 3
  - IEND: 1

C2PA Data:
  - C2PA metadata entries: 3
  - Claims found: 1
  - Assertions found: 2
  - AI Generated: Yes
  - AI Model: ChatGPT

Binary Analysis:
  - JUMBF boxes found: 5
  - C2PA signatures found: 3
  - Relevant strings found: 12

============================================================
For detailed information, check the generated JSON files.
============================================================

Understanding the Results

For detailed analysis, check the generated JSON files which contain all extracted information. The C2PA/CAI metadata can help verify:

  • If an image was generated by AI
  • Which AI model generated it
  • When it was created
  • Other provenance and authenticity information

License

MIT