Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
L

lenssort

> 编程语言
Open source

Making some cool pfps ‍

199 stars0 likes0 views
WebsiteGitHub

About

Making some cool pfps ‍

Lenssort

Using facial recognition and pixelsorting on images to create glitched, Snapchat-like lenses.

Utilizes pixelsort, another project I am involved in. Make sure to check it out!

Usage

With Docker:

bash
git clone https://github.com/BernardZhao/lenssort.git
cd lenssort
docker-compose up
# Make sure to include the -o flag, previews won't show up in the container.
docker-compose run lenssort python -m lenssort examples/example1.jpg -m face -o example_result.png

Manually:

Requires Python 3.6 >=. Make sure you have dlib Python bindings installed!

bash
git clone https://github.com/BernardZhao/lenssort.git
cd lenssort

# Can skip virtual environment if desired
python -m venv venv 
source venv/bin/activate

pip install -r requirements.txt

python -m lenssort %PathToImage% [mask_type] [params]

Mask types:

Mask name Description
eyes Sort the eyes.
face Sort the face, within the brows and chin.
shuffle Sort a polygon randomly generated over facial features.
censored Sort the eye area with a thick bar.
facemask Sort the area of the face under the eyes.
tears Sort tear-like lines below the eyes.

Parameters:

Parameter Flag Description
Invert -i Inverts the mask. May produce cool results.
Angle -a Sorting angle. Overrides internal default for the mask.
Output path -o File output path. Previews image if not provided.

Examples

python -m lenssort examples/example1.jpg -m face

python -m lenssort examples/example1.jpg -m face -i -a 90

python -m lenssort examples/example1.jpg -m eyes -i

python -m lenssort examples/example3.jpg -m facemask

python -m lenssort examples/example3.jpg -m shuffle

python -m lenssort examples/example2.jpg -m censored

Todo

  • Expose pixelsort args: sorting function, interval function, etc.
  • Validate mask: No out of bounds
  • Mask compositions: Ex: (face - eyes + ...)

And more masks ofc

Issues· 1 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythonface-recognitionglitch-artlenspixelsort

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言