gre / gl-react

gl-react – React library to write and compose WebGL shaders

Home Page:https://gl-react-cookbook.surge.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to apply transformations/filtering without rendering component

Orxcle-xx opened this issue · comments

Hi,

Lets suppose I have an uri to a local file and/or base64 of an image.

I want to apply contrast / saturation / brightness transformation to the image without showing anything to the user and then save it to Camera Roll.

Basically, I want to do something with a Surface without rendering Surface.

Is it possible?

P.S I will show the results of the transformation to the user, but using another library:
https://github.com/iyegoroff/react-native-color-matrix-image-filters
As gl-react is unable to show my image in a proper angle ( it gets rotated ).
So that's why I am looking for a hack.

Thank you in advance.

Best Regards

Have you tried hiding it from the user by rendering it off the screen?

As @superandrew213 suggested hiding the element or wrapping it in a div with display: 'none' should be enough for the hack you are after.

Sounds like it would be easier to simply rotate the image however. Using a different lib for the sole purpose of displaying a filtered image seems counter-intuitive, particularly because for example, the same value for saturation may not render the same result in both libs.

@Orxcle-xx I would like to update my comment, as the rotation of the image is likely due to the image size, try and resize the image by half. For some reason when the image is too big ~3000 - 4000px it gets rotated. I had the same issue.

Be carefull with JPEG images, check if there are some strange exif orientation in the metadata. I got some weird similar problems like your.