• Stars
    star
    141
  • Rank 259,971 (Top 6 %)
  • Language
    JavaScript
  • Created over 11 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🎨 Photo editing JavaScript library

PhotoJShop

A JavaScript photo editing library packaged in a simple jQuery plugin

PhotoJShop is a JavaScript library for photo editing using the canvas and kernel convolution matrixes, aiming to reproduce most usual filters. A demo of its capabilities can be seen in Nuophoto, a project that uses this library for all the editing (Although an older version)

The idea is to provide a simple library to developers that will allow quick integration of photo filters to their website.

Demo

If you clone the repo, simply open index.html, which is a very simple demo of the plugin's capabilities. The project has Github's pages enabled, so you can see the demo page online:

Download

Head over to the releases list and grab the lastest one

Usage

After including jQuery, include photojshop.jquery.js. Once loaded you simply need to call it on a valid element. You have to ensure that the element has loaded, $(document).ready() doesn't mean images have loaded!

Right now it works on Canvas and images, so you would call it like so:

$('#img1').PhotoJShop("blur");

// The following would produce the same effect:
$('#img1').PhotoJShop({ effect : "blur"});

// Color effects can be applied at the same time:
$('#img1').PhotoJShop({
  effect  : "blur",
  color   : "b&w"
});

Effects can also be chained if replace is set to true (Which is by default)

$('img').PhotoJShop("blur").PhotoJShop("lighten");

You can also set replace to false, and obtain the dataURL of the filtered photo:

$('#image1').attr('src',
  $('#image2').PhotoJShop({
    effect : "blur",
    replace : false
  })
);

Do you want to do a non-implemented effect? Use the custom mode, and define your own matrix, in the example below we will use a version of blur that also lightens the image:

$('img').PhotoJShop({
  matrix :  [ [1, 1,  1],
              [1, 1.5,1],
              [1, 1,  1] ]
});
// That code is exactly the same as the following:
$('img').PhotoJShop({
  matrix :  [ [1.5] ]
});

You can use any size for the matrix, although it must be square. You can use a 1x1 matrix for example, which will lighten/darken the image if you use a bigger/lower value than 1.

Parameters

Parameter Values Description
effect blur, sharpen, emboss, lighten, darken, edge-enhance, edge-detect, hard-edge, laplace, custom Select the effect you want to apply
replace true, false If true the result of the filter will replace the original image/canvas data and return the jQuery object for chainability. If false it will return the dataURL of the resulting image
matrix JavaScript matrix Use this with the custom effect (Although if you set the matrix you don't have to specify the effect), the matrix can be any size, but it must be in JavaScript format.
color b&w, sepia, vintage, recolor, red, blue, green Apply a coloring effect. Red, blue and green leave only the corresponding channel on all channels.

Changelog

1.0.4

  • Add two new effects: Hard-edge and Laplace

1.0.1

  • Add minified version
  • Released in jQuery plugin repository

1.0.0

  • First stable release

Meta

Analytics

More Repositories

1

robinhood-node

📈 NodeJS client for Robinhood Trading 🔥
JavaScript
696
star
2

react-ds

🔥 React Drag To Select component (tiny, touch friendly, and no dependencies!)
JavaScript
165
star
3

regex101-osx

Regex101 packaged as an offline Mac OSX application
JavaScript
76
star
4

smart-area

📝 Textareas on Steroids - AngularJS 1 directive
HTML
66
star
5

nuophoto

📷 Web based image editor
JavaScript
61
star
6

TreeGenerator

🌲 Trees with JavaScript, just because why not?
JavaScript
25
star
7

sonar.css

CSS3/Sass Animated Attention Seekers
CSS
17
star
8

Nebula

An HTML5+JS nebulosa effect, it displays text by making circles float inside it.
JavaScript
12
star
9

node-timespan

🕐 Simple npm package to get human readable timespans
TypeScript
11
star
10

react-undo

React Component for easy undo/redo on any component's props
JavaScript
9
star
11

ng-multiselect

Angular directive for multiselect elements with a nice UX
JavaScript
8
star
12

bananajs

Get colors from words (give it banana, get yellow)
JavaScript
8
star
13

typesafe-fetch

Type-Safe version of fetch that uses OpenAPI TypeScript definitions to check API calls at compile type. This is really AWESOME if you call APIs from a JS frontend 🔥
TypeScript
7
star
14

SplineJS

JavaScript library for numerical computing and plotting
JavaScript
5
star
15

aurbano-theme

My personal color scheme for IDEs (IntelliJ IDEA & VS Code)
5
star
16

line-art

A little experiment with animated lines trying to create an elegant visual experience.
JavaScript
5
star
17

asciimg

💻 Images on your terminal - Command line tool written in Perl
Perl
5
star
18

react-dragger

Tiny React Dragging library (mobile ready)
JavaScript
5
star
19

Spirographjs

JavaScript Spirograph rendering
JavaScript
4
star
20

angular-timespan

Simple directive to get human readable timespans from any two dates
JavaScript
4
star
21

Wikiline

A global timeline created from Wikipedia
PHP
4
star
22

ash

🐚 a(lex)sh(ell) -- Remaking bash to practice modern C++ :)
C++
4
star
23

sudoku_py

Sudoku Solver in Python
Python
4
star
24

language-graph

Directed World languages graph (Only Indo-European languages for now)
JavaScript
4
star
25

html5-business-simulator

HTML5 Business Simulators for an e-Learning course
JavaScript
4
star
26

react-component-starter

Starter kit to release React components
CSS
3
star
27

ui-grid-css

Improved CSS for UI-Grid (Available as Sass or CSS)
CSS
3
star
28

angular-requirejs-seed

Starter project with Angularjs Requirejs Bower Grunt and Bootstrap
JavaScript
3
star
29

dotfiles

copy of my dotfiles
Vim Script
3
star
30

resource-path

🔗 Tiny module to generate /resource/:paths for APIs
JavaScript
3
star
31

HTML-Clock

⌚ Clock made with HTML5+CSS3+JS
JavaScript
3
star
32

flocking-simulation

Flock Behavior Simulation rendered in WebGL
JavaScript
3
star
33

WebVisualizer

Watch the web using WebGL (Under development)
JavaScript
3
star
34

enigma_py

Python implementation of the Enigma machine
Python
2
star
35

aurbano.eu

Personal website and blog
JavaScript
2
star
36

Runaudio

iOS app that will play music at the BPM you're currently walking/running
Swift
2
star
37

procedural-maps

Procedural Map Generator Playground
JavaScript
2
star
38

backbone-demo

Backbone, Mustache and Underscore demo
JavaScript
2
star
39

evolving-beings

ML/Reinforcement learning applied to the evolution of simple "beings"
Jupyter Notebook
2
star
40

Cloudclient

☁️ Web client for cloud services like Dropbox
PHP
2
star
41

randchess

Chess, but every piece can be customised
TypeScript
1
star
42

CaveGame

The very typical cave/chopper game, ported to iOS using iPad's Codea app
C
1
star
43

express-session-postgres

Store an Express session in Postgres (type-safe)
1
star
44

SubtitledVideo

Subtitled flv video player for the TTLM1 schema
HTML
1
star
45

QuePiensas

[Archived] Social network I worked on back in 2009
PHP
1
star
46

blink

[Under development] Real-time, unopinionated, modern web framework for node
JavaScript
1
star
47

irc-gui-java

IRC Client GUI implemented in Java
Java
1
star
48

Swarm-SimuLTE

Robotic Swarm simulation using Omnet++ and SimuLTE
1
star
49

global-npx

Run npx commands from within a Nodejs application
JavaScript
1
star
50

ios-uaf-authenticator

UAF Authenticator for iOS with TouchID support
Swift
1
star