Scramb.py is a region based JPEG Image Scrambler and Descrambler written in Python

Overview

Scramb.py

Scramb.py is a region based JPEG Image Scrambler and Descrambler written in Python.

Main features

  • Scramb.py can scramble images regions. So you can e.g. scramble only the face of a person.
  • All you need to descramble the image is encoded in a data „snake“ around the image. The scrambled image is thus a bit wider as the original.
  • You can select different scramble modes.
    • When you slightly scramble a region, a thumbnail of the image can still be recognized.
    • If you use the heavy scrambler, you cannot guess the content.
  • You can set a password
  • You can include short text messages that will show up upon descramble
  • Easy to use: Windows Drag & Drop descramble
  • Survives multiple re-encodings of an image down to JPEG quality around 30 something, when the image gets ugly and blocky still chances that they decode
  • Does not depend on any meta data within the JPEG file, as these are normally completly stripped by all major social media sites.

In this example, only Lenna's face was scrambled and the scrambled image is password protected. You can actually try the example images in this repo with scramb.py yourself! Also, people get offended when Lenna is used (although, now we also have Fabio, which I use as a Black/White Test Image!... so, Lenna is scrambled here in this repo :-)

Use cases

  • Offend the easily offended less: Upload pictures to sites like Twitter, Facebook, DeviantArt etc. (esp. Social Media) that normally trigger people to report these despite being okay and according to TOS of the site.
  • Upload a pic as a teaser but give away the password only to a small section of people

Usage

Scramble

scramb.py -i [-m ] -o [OPTIONS]

You must use -m and/or -s for scramb.py to detect that you want to scramble.

Descramble

scramb.py also usable for drag & drop

scramb.py -i -o

Calculate Residue

scramb.py -r

Options

-x -y -z

Specific parameter for the chosen scrambler, see table below.

-s

The scrambler to be used

scrambler x y z What it does
matrix seed turn percentage (10=10%, 100=100%, 170=170%) - turns a group of 2x2 blocks clockwise. Does not work on lonely pixels.
medium seed rounds distance moves a block a maximum of distance left or right. Runs over all blocks rounds times.
heavy seed rounds - moves every block somewhere else rounds times

-2

Blowup image by 2x

--quality=

--quality=10..100

JPEG Output Quality 0-100, 100=best, default=100

--no-logo

do not include Logo in Image

-t

-t " "

Embed text to show when descrambling (max. 400 chars)

--silent

Do not pause on descramble for displaying text

-p

Scramble with password (ask for it)

--password=

--password=

Scramble with

Caution: it's then in your console history! Use -p instead!

--stealth

Hide password use from generated image. You must run descrambling with -p or --password option then! Descrambling without these options will otherwise not promt for a password and the descrambled image is still scrambled (in a different way).

--overwrite

Overwrite output file when it exists

Details

Image quality

Slight scramble will produce a near identical descrambler image. Scramb.py scrambles 8x8 blocks to best encounter effects of jpeg artifacts. Nevertheless the heavy scrambler will produce a grid like structure in bright (esp. red/blue) regions of the descrambled image. This happens because of color subsampling in JPEG by the factor 2 and in a scrambled image, blocks of brigthness and darkness now lie next to each other when in the original image they do not.

You can circumvent that with the -2 option, blowing up the image by 2x. While descrambling, it will automatically be reduced to the original size.

Regional scrambling

The main advantage of this scrambler in comparison to other image scrambles is that it can scramble only parts of an image. For that you provide the scrambler also a black and white image where you marked the regions you want to scramble in white. You can easily create such an image with Photoshop, GIMP or even Windows Paint. Just be carefull not to overwrite your original image with Paint ;-D

Seed based scrambling

All of Scramb.py's Scrambling Algorithms use a Seed to generate pseudo random numbers. This is essential so that when descrambling, Scramb.py can create the substitution map that was used for scrambling.

Password protection

You can set a password. Be aware that the password system and the used Random Number Generator are nowhere near security and not tested for that application. Consider the password system to be like a cheap padlock.

Text

You can add a short text to be shown while descramble This text is not password protected

Scramb.py - Logo

A small logo is added to help people find this descrambler „scrambled by Scramb.py“ You can of course switch that off if you wish

Drag & Drop

Windows use is easy for descramble (Scramble needs commandline;-)

Backdoor Free Code

Code is easy to follow so feel free to check it for backdoors. You can even delete the encoded logo

Full resolution examples

Image region

Original

Scramble mask

Output, slightly scrambled

Full image

Original

Output, heavy scramble

Notes

Sample Images from

http://r0k.us/graphics/kodak/index.html

https://en.wikipedia.org/wiki/Lenna

You might also like...
Easily turn large sets of image urls to an image dataset. Can download, resize and package 100M urls in 20h on one machine.
Easily turn large sets of image urls to an image dataset. Can download, resize and package 100M urls in 20h on one machine.

img2dataset Easily turn large sets of image urls to an image dataset. Can download, resize and package 100M urls in 20h on one machine. Also supports

GTK and Python based, simple multiple image editor tool
GTK and Python based, simple multiple image editor tool

System Monitoring Center GTK3 and Python3 based, simple multiple image editor tool. Note: Development of this application is not completed yet. The ap

An open source image editor which can manipulate an image in many ways!

Image Editor - An open source image editor which can manipulate an image in many ways! If you need any more modes in repo or I

Image enhancing model for making a blurred image to be somehow clearer than before

This is a very small prject which helps in enhancing the images by taking a Input images. This project has many features like detcting the faces and enhaning the faces itself and also a feature which enhances the whole image

This app finds duplicate to near duplicate images by generating a hash value for each image stored with a specialized data structure called VP-Tree which makes searching an image on a dataset of 100Ks almost instantanious
This app finds duplicate to near duplicate images by generating a hash value for each image stored with a specialized data structure called VP-Tree which makes searching an image on a dataset of 100Ks almost instantanious

Offline Reverse Image Search Overview This app finds duplicate to near duplicate images by generating a hash value for each image stored with a specia

Quickly 'anonymize' all people in an image. This script will put a black bar over all eye-pairs in an image

Face-Detacher Quickly 'anonymize' all people in an image. This script will put a black bar over all eye-pairs in an image This is a small python scrip

Fast Image Retrieval is an open source image retrieval framework

Fast Image Retrieval is an open source image retrieval framework release by Center of Image and Signal Processing Lab (CISiP Lab), Universiti Malaya. This framework implements most of the major binary hashing methods, together with both popular backbone networks and public datasets.

Fast Image Retrieval (FIRe) is an open source image retrieval project

Fast Image Retrieval (FIRe) is an open source image retrieval project release by Center of Image and Signal Processing Lab (CISiP Lab), Universiti Malaya. This project implements most of the major binary hashing methods to date, together with different popular backbone networks and public datasets.

starfish is a Python library for processing images of image-based spatial transcriptomics.
starfish is a Python library for processing images of image-based spatial transcriptomics.

starfish: scalable pipelines for image-based transcriptomics starfish is a Python library for processing images of image-based spatial transcriptomics

Comments
  • Refactoring code

    Refactoring code

    1. Simplified most of the if conditions
    2. removed nested conditions
    3. Fix typos.
    4. Renamed most variables to meet the requirements of PEP 8
    5. Added indents, tabs wherever needed according to the recommendations of PEP 8
    6. Fixed typos and added TODO for the future
    7. I divided 1 file into several so that there was no legacy code
    8. I moved the main code to main.py

    If you have any questions, you can ask them to me.

    opened by DavidRomanovizc 7
Releases(v0.3.1)
  • v0.3.1(Feb 6, 2022)

    0.3.1 - 2022-01-22

    Added

    Changed

    Fixed

    • Bug when patching images with portrait aspect ratio removed
    • Bug when mask for patching starts with white pixels removed
    Source code(tar.gz)
    Source code(zip)
A Python package implementing various HDRI / Radiance image processing algorithms.

Colour - HDRI A Python package implementing various HDRI / Radiance image processing algorithms. It is open source and freely available under the New

colour-science 111 Dec 06, 2022
Fast batch image resizer and rotator for JPEG and PNG images.

imgp is a command line image resizer and rotator for JPEG and PNG images.

Terminator X 921 Dec 25, 2022
GTK and Python based, simple multiple image editor tool

System Monitoring Center GTK3 and Python3 based, simple multiple image editor tool. Note: Development of this application is not completed yet. The ap

Hakan Dündar 1 Feb 02, 2022
A python script for extracting/removing exif data from images by @AbirHasan2005

Image-Exif A Python script for extracting exif metadata from images. How to use? Using this script you can extract exif data from image and save in .c

Abir Hasan 13 Dec 16, 2022
利用近邻法的弱点实现图片缩小后变成另一张图

这是我一个视频的配套代码。 视频是:利用近邻法的弱点实现图片缩小后变成另一张图 https://www.bilibili.com/video/BV1Lf4y1r7dZ 配套代码中,仅generate.py是核心文件,其余的图片神马的,都是赠品。 这个核心文件利用了近邻法缩放的弱点,可以将图a的像素按

偶尔有点小迷糊 182 Dec 19, 2022
PyLibTiff - a wrapper to the libtiff library to Python using ctypes

PyLibTiff is a package that provides: a wrapper to the libtiff library to Python using ctypes. a pure Python module for reading and writing TIFF and L

Pearu Peterson 105 Dec 21, 2022
Image2scan - a python program that can be applied on an image in order to get a scan of it back

image2scan Purpose image2scan is a python program that can be applied on an image in order to get a scan of it back. For this purpose, it searches for

Kushal Shingote 2 Feb 13, 2022
3D Model files and source code for rotating turntable. Raspberry Pi, DC servo and PWM modulator required.

3DSimpleTurntable 3D Model files and source code for rotating turntable. Raspberry Pi, DC servo and PWM modulator required. Preview Construction Print

Thomas Boyle 1 Feb 13, 2022
An executor that performs standard pre-processing and normalization on images.

An executor that performs standard pre-processing and normalization on images.

Jina AI 6 Jun 30, 2022
An esoteric visual language that takes image files as input based on a multi-tape turing machine, designed for compatibility with C.

vizh An esoteric visual language that takes image files as input based on a multi-tape turing machine, designed for compatibility with C. Overview Her

Sy Brand 228 Dec 17, 2022
Python wrappers for external BART computational imaging tools and internal libraries

bartpy Python bindings for BART. Overview This repo contains code to generate an updated Python wrapper for the Berkeley Advance Reconstruction Toolbo

Max Litster 7 May 09, 2022
Python Digital Art Generator

Python Digital Art Generator The main goal of this repository is to generate all possible layers permutations given by the user in order to get unique

David Cuentas Mar 3 Mar 12, 2022
A python program to generate ANSI art from images and videos

ANSI Art Generator A python program that creates ASCII art (with true color support if enabled) from images and videos Dependencies The program runs u

Pratyush Kumar 12 Nov 08, 2022
3D Reconstruction Software

Meshroom is a free, open-source 3D Reconstruction Software based on the AliceVision Photogrammetric Computer Vision framework. Learn more details abou

AliceVision 8.7k Jan 02, 2023
Xmas-Tree-GIF-Tool - Convert any given animated gif file into an animation in GIFT CSV format

This repo is made to participate in Matt Parker's XmasTree 2021 event. Convert a

Aven Zitzelberger 2 Dec 30, 2021
Graphical tool to make photo collage posters

PhotoCollage Graphical tool to make photo collage posters PhotoCollage allows you to create photo collage posters. It assembles the input photographs

Adrien Vergé 350 Jan 02, 2023
Fast Image Retrieval is an open source image retrieval framework

Fast Image Retrieval is an open source image retrieval framework release by Center of Image and Signal Processing Lab (CISiP Lab), Universiti Malaya. This framework implements most of the major binar

CISiP Lab 39 Nov 25, 2022
An agnostic Canvas API for the browser-less and insane

Apollo An agnostic Canvas API for the browser-less and mildly insane. Project Apollo is a Pythonic re-imagining of HTML Canvas element implementati

1 Jan 13, 2022
MaryJane is a simple MJPEG server written in Python.

MaryJane is a simple MJPEG server written in Python.

bootrino 152 Dec 13, 2022
A pure python implementation of the GIMP XCF image format. Use this to interact with GIMP image formats

Pure Python implementation of the GIMP image formats (.xcf projects as well as brushes, patterns, etc)

FHPyhtonUtils 8 Dec 30, 2022