Jump to content

modifying and transforming images question


Recommended Posts

I am new to Pixi and webgl so I apologize for the simple question which is below.  I have tried several ways of completing my work trying to create an image editing tool but hit several speedbumps (premultiplied alpha pixel changes in a 2d context, being totally new to webgl2, etc).  I have my app "done" using 2d canvas but there are many problems that it seems like webgl be a solution for.

Is it possible to do the following with Pixi.js?
- load image data as a Uint16Array (I was going to load data from PNG using pngtoy or UPNG to get the Uint16Array)
- display, transform and scale the image via mouse actions (ie: zoom and pan using mouse) 
- modify individual pixel values in 16-bit (I am working with 16-bit per channel images but display in 8-bit is fine as long as I can work in 16-bit then convert that result to 8-bit)

Is Pixi.js the right tool to do the 3 items above?  I am new and just looking for direction on what tools I should use.  

Thanks for your time!

Edited by mortac8
Link to comment
Share on other sites

Uint16Array, like, 6-5-5 or 16 bits per channel? Yes, you can do it. If you know how webgl does it :) PixiJS objects do same things, just easier to write code. If you dont know - well, you should learn it.


PixiJS texture modification is done either through

1. Canvas2D , Texture.from(canvas), texture.update() every time its updated

2. Your custom array + TextureResource that has a call of "texImage2d" with special format types . Search this subforum & pixijs issues for "Uint16Array", "texImage2d" to see how other people did it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...