Convert image or video into pixelized render
Web Interface:
python web.py
- Open browser to: http://127.0.0.1:8000/
via Code:
python pyxelart.py
pip install -r requirements.txt
Best practice, use via web interface
Via Code:
Instantiate the PyxelArt class
Call either convert_image or convert_video
Optional parameters:
- file_name - original image or video filename (REQUIRED)
- width - number of pixel's horizontally for resultant image
- height - number of pixel's vertically for resultant image
- method = [pyxelate, greyscale, ascii]
- pyxelate - new "pixel" is average of those in block
- greyscale - new "pixel" is greyscale of the Pyxelate average of those in block
- ascii - new "pixel" is ascii density representation of greyscale for this block
- show_original - display original image prior to conversion
- You may add additional fonts in the /fonts directory, and they will automagically be available to the user
- This was written for local, it is not advertised as "safe" from a file/validation POV
- High Priority
- Progress feedback for video processing
- Still -> Video using Pyxelate/Greyscale/ASCII from 1 > 256
- Spinner/Progress after Pyxelate clicked
- Clean up some dupe code in video section for image init
- Use is_image everywhere
- Handle errors on file submission
- Handle general errors gracefully
- Medium Priority
- On change framerate, actually change framerate so plays in same time, just jittery
- Get video to play natively
- Is there method to read/average/modify image array with NumPy or CV2 much more quickly?
- Lower Priority
- Input = webcam, Output = LiveView, stuttered framerate, but acceptable
- Layout at smaller breakpoints
- Change font size based on final image size
Clean up requirements.txtGUI front end- replaced by web interface, more portableCommand line front end- web and code sufficientSave new image fileOnly accept 1 param for pixel/chunks, interpolate other dimensionRename app from pixelArt to pyxelArtBuild web frontend (flask/jinja)Interactive screen, respond to changes in process formModify Settings and re-PyxelArt underneath resultant image/videoReset button on color pickerShow preview of regular image (even from video)Controls belowRetain settingsAdd original to 3 button optionAdd 'Change file' button on process entry screenStyle forms nicelySave thumbnail from videoDisplay thumbnail on Settings pagePreview button for video, Pyxelate for imageCreate Video for videosSlider for granularitySelect diff thumbnail (maybe pre-grab 5, 0/20/40/60/80/100)Wire up Original buttonSettings Page re-doPre-count video frames (how long take for 1 min file?)Estimate time based on frame-rate for video processingAdd Processing after file upload submitting commencesASCII Options: Simplified/ComplexProper intro and explainerAbout/Help Pagei.e. nav barClean up static files
Caleb Cohen
Caleb@Hail2Pitt.org
https://github.com/PittCaleb
Twitter: @PittCaleb