What is best in this scenario, Base64 or still images?

Part of my application The great use of image manipulation. Crop, filters, etc. Using ajax messages and an image processing server using various methods. Each manipulation action that the user takes creates a physical image without deleting the original, in order to allow the system to "cancel", giving the user the opportunity to return his image back to any previous point in time.

All these “temporary” images are deleted through a message to the server when the user ends the session or closes his browser.

For modern browsers, we will expand the capabilities of image processing using html5. Using canvas gives us the opportunity to perform all these manipulations with images on the client side, without creating additional static images, encoding and dynamically injecting base64 data.

My concern is the cancel system. Using the static return method, we store an array of objects containing links to static images. This gives full undo functionality. However, if we do this to all clients, then this array will actually have to contain copies of base64 data for each undo point. For each image that the user manipulates (a typical use case may be 20 original images with 4-5 excellent points).

Before spending a couple of days prototyping, I was hoping that someone might have comments regarding this method. Is that a good idea? Bad idea? Does a huge base64 image data object save a bad idea in terms of browser performance and memory usage?

Any thought is welcome, thanks in advance.

+4
source share
1 answer

It is a bad idea. Base64 takes up 30% more storage that encodes the actual data. If your images on the server are accessible through actual URLs, consider keeping links to <img> elements separate from the DOM.

0
source

All Articles