javierbyte / img2css

Convert any image to pure CSS. Recreates images using only box-shadows.
https://javier.xyz/img2css/
BSD 3-Clause "New" or "Revised" License
2.48k stars 189 forks source link

Extra features {rotation, colour inversion, b&w conversion} #11

Open lovemeblender opened 8 years ago

lovemeblender commented 8 years ago

It would be nice to add some extra features such as rotation, colour inversion or b&w conversion.

asafyish commented 8 years ago

It think it's better if image manipulation will be on the source image, there is a large amount of tools for that (lwip, jimp, camanjs). img2css should be focused on 1 thing. img-2-css.

lovemeblender commented 8 years ago

There are two important reasons in favor of this enhancement:

  1. Say that you generate a CSS picture using img2css and then you need to rotate it. Why would you go back to the original picture, rotate it and then generate the CSS again? What if you need to do several manipulations?
  2. Performing the manipulations on the CSS side is going to be faster than working directly on the image.

On top of that, img2css seems to be gaining popularity. It would be nice to give more life to this project by extending its main functionality.

ghost commented 8 years ago

Use CSS to rotate it :P

javierbyte commented 8 years ago

@lovemeblender,

I agree with @asafyish and @s3r1alpari4h, I think that img2css should focus on the conversion.

But you are right in the need to be able to extend the core functionality, what do you think about adding something where you can manipulate the image data without needing to read the image from a canvas? That way you can add as many filters as you want, without having to include those filters to the core.

lovemeblender commented 8 years ago

Are you suggesting directly manipulating the RGB array as in base64ImageToRGBArray.js ?