https://github.com/connor-makowski/pixelator

Pixelate images to a specified size and color palette for AI/ML and various other purposes

https://github.com/connor-makowski/pixelator

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.6%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

Pixelate images to a specified size and color palette for AI/ML and various other purposes

Basic Info
  • Host: GitHub
  • Owner: connor-makowski
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 298 KB
Statistics
  • Stars: 10
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Created over 6 years ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.md

Pixelator

A simple python package to pixelate images given a BGR color palette

Features

  • Users can:
    1. Load in array data, image files or capture directly from a camera
    2. Pixelate images to a specific color palette and image resolution
    3. Access pixelated array data and / or write it back to an image file

Technical Docs

https://connor-makowski.github.io/pixelator/pixelator/pixelator.html

Setup

Make sure you have Python 3.7.x (or higher). You can download it here.

Installation

pip install pixelator

Getting Started

Import the pixelator into your project from pixelator import Pixelator

Some important notes: - All data is stored and processed as BGR (to match open cv2) - EG: Provided pallettes should be in BGR

Examples

Load from a file: ```py from pixelator import Pixelator

Use the input filename provided

image = Pixelator(filename='./images/input.jpg')

Pixelate the image to a 28x28 black and white array

pixelated_image = image.pixelate( width=28, height=28, palette=[[0,0,0],[255,255,255]] )

Write to output.png scaled up to a 300x300 image (to be easily viewed)

pixelatedimage.write(filename='./images/outputtest_1.jpg', width=300, height=300) ``` Input:

Output:

Capture from a webcam: ```py from pixelator import Pixelator

Capture from a webcam since no data or filename is provided

image = Pixelator()

Pixelate the image to a 64x64 black, white and multiple gray array

pixelated_image = image.pixelate( width=64, height=64, palette=[[0,0,0],[80,80,80],[160,160,160],[200,200,200],[255,255,255]] )

Write to output.png scaled up to a 500x500 image (to be easily viewed)

pixelatedimage.write(filename='./images/outputtest_3.jpg', width=300, height=300) ```

Access Pixelator Data: ```py from pixelator import Pixelator

Use the input filename provided

image = Pixelator(filename='./images/input.jpg')

Pixelate the image to a 28x28 black and white array

pixelated_image = image.pixelate( width=28, height=28, palette=[[0,0,0],[255,255,255]] )

Show pixelated image data

print(pixelated_image.data)

Show Color Counts:

print(pixelatedimage.getcolor_counts()) ```

Owner

  • Name: Connor Makowski
  • Login: connor-makowski
  • Kind: user
  • Location: Cambridge, MA

Cave Lab Project Manager and Digital Learning Lead at MIT

GitHub Events

Total
  • Release event: 1
  • Delete event: 5
  • Push event: 6
  • Pull request event: 3
  • Create event: 3
Last Year
  • Release event: 1
  • Delete event: 5
  • Push event: 6
  • Pull request event: 3
  • Create event: 3

Committers

Last synced: over 3 years ago

All Time
  • Total Commits: 10
  • Total Committers: 1
  • Avg Commits per committer: 10.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Connor Makowski c****8@g****m 10

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 17
  • Average time to close issues: N/A
  • Average time to close pull requests: about 2 months
  • Total issue authors: 0
  • Total pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.41
  • Merged pull requests: 9
  • Bot issues: 0
  • Bot pull requests: 7
Past Year
  • Issues: 0
  • Pull requests: 4
  • Average time to close issues: N/A
  • Average time to close pull requests: less than a minute
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • connor-makowski (9)
  • dependabot[bot] (7)
Top Labels
Issue Labels
Pull Request Labels
dependencies (7)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 34 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 5
  • Total maintainers: 1
pypi.org: pixelator

Pixelate images to a specified size and color palette for AI/ML and various other purposes

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 34 Last month
Rankings
Dependent packages count: 10.1%
Stargazers count: 17.7%
Average: 20.2%
Dependent repos count: 21.6%
Downloads: 21.8%
Forks count: 29.8%
Maintainers (1)
Last synced: 11 months ago

Dependencies

requirements.txt pypi
  • Pillow ==6.2.1
  • numpy ==1.17.3
Dockerfile docker
  • python 3.13-slim build
pyproject.toml pypi
  • opencv-python >=4.11.0.86
  • type_enforced >=1.2.0