Skip to content

PlethoraLabs/PhotoScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PhotoScript

An experimental image manipulation library written in JavaScript

Usage

Use the .photoscript class in your image tags, along with auto-levels and sharpen. The sharpen class, can also take an optional parameter: sharpen-75, sharpen-50, etc.

document.addEventListener('DOMContentLoaded', function(){

  // FIND ALL IMAGES WITH A .photoscript CLASS AND APPLY FILTERING ACCORDING TO CLASS NAMES
  Array.prototype.slice.apply(document.querySelectorAll('img.photoscript')).forEach(function(img){

    new PhotoScript(img).render()

  });

  // SINGLE IMAGE WITHOUT .photoscript CLASS
  new PhotoScript(document.getElementById('my-awesome-image'))
  .autoLevels()
  .sharpen({ factor: 0.5 })
  .show();

  // ALTERNATE SYNTAX
  new PhotoScript(document.querySelector('img.filterme'))
  ['autoLevels']()
  ['sharpen']({ factor: 0.9 })
  ['show']();


});

TODO

var image = new PhotoScript(document.querySelector('img.filterme'));
image.selectArea(0,0,50,100).sharpen().selectArea(50,0,100,100).invert().show();

References and Sources

Automatic color leveling for HTML images by AJ Farkas

About

An experimental image manipulation library written in JavaScript

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors