HTML Canvas API - research

Hello from the UXP Team,
We are evaluating support of HTML Canvas APIs in UXP. In order to do so, I need some input from you all. I would love to get a sample, screen shot or any quick peek to understand what you intend to build or may have already built using canvas APIs. Although this is just an assessment, it would be of great help.

1 Like

I would like to have possibility to have:

  1. direct pixel manipulation read and write
  2. place “Blob” containing image into the canvas
2 Likes

Here are some sample projects I made with the Canvas API;


Hope it helps

1 Like

@pkrishna This is must have: CanvasRenderingContext2D.globalCompositeOperation - Web APIs | MDN

Compositing layers together. It might be preferable to calculate pixels the same way as Photoshop does.

1 Like

Are there any differences between Photoshop’s blend mode algorithm and the MDN standard? I haven’t noticed any yet. I always thought the math is pretty straight forward and that all technologies implement it the same way :smiley:

There are mutliple blending modes and I think that e.g. in Gimp some of them are a bit different than in PS. Also recently I did bitmap compositing outside of Photoshop and when I compared that I found out that some pixels differs e.g. by value of 1-3 (range 0-255). I think this was mostly due to different rounding implementation in Jimp. Also photoshop has its own color settings where you can adjust blending. And e.g. when you blend text it work differently than rasterized text. Depends on your settings.

And Lab color space is chapter on its own. I spend days to find out how to convert RGB <-> Lab the same way as Photoshop but it turned out it is unpredictable blackbox. There might even be some lookup tables.

Color spaces are another good point. Websites are fine with RGBA 8/bit per channel. But in Photoshop we might need something more. Also if there would be easy to way to load PSD/TIFF and other less web common format into canvas that would be great :slight_smile:

@pkrishna , are there any news for the canvas?

We are hoping that phase1 is made available by the end of this year.

2 Likes