How To Set Opacity Of An Image Opacity At The Time Of Upload?
Solution 1:
You cannot manipulate the image's opacity while it uploads. You'll have to upload the image, save it, and then process it at a later time with something like setimageopacity()
Solution 2:
You can do it thru canvas. So the Flow is as follows.
upload image from imput file, and get its base 64 string.
create html image tag, add your base 64 to it`s src attribute.
draw that image to canvas. Here you should specify opacity whyle drawing in canvas. Feel free to google how to draw image with opacity in canvas.
from canvas (with image drawn as you wanted), get base 64 of the image.
do a post request to save your base 46 image to back end.
Edit.
I am assuming you want to upload the image from the browser. The original image can be uploaded from simple form. (edited base 64 one could be added to same form too in background) Here is an example of getting base 64 from input file. Preview an image before it is uploaded
Post a Comment for "How To Set Opacity Of An Image Opacity At The Time Of Upload?"