Today we announce the release of Batch Editing API. You can now send a batch of images to Pixo Editor, the user edits the first image, and all changes are applied to the whole batch. Check the following video to see it in action:
What is it good for
When you want to apply the same operations to a batch of images. For example, if you have a gallery of 100 images, and you want to apply the same filter to all, batch operation would be perfect. Pixo’s Batch Editing is perfect for manipulations that do not affect or rely on image dimensions, such as:
- apply Filter
- add Frame
- apply Shape
- adjust Color Corrections
- Transform
But it is also good enough for the rest of the manipulations:
- adding Stickers
- adding Text
- Blur
- Drawing
- Crop
Even if images differ in dimensions and ratios, Pixo will take this into consideration and will smartly apply changes to the batch.
How does it work
All you need to do is to pass array of images to the edit()
method, and replace one of the toImage()
, toDataURL()
or toBlob()
with toImages()
, toDataURLs()
or toBlobs()
in the onSave()
callback, like this:
<script src="https://pixoeditor.com/editor/scripts/bridge.m.js"></script> <script> new Pixo.Bridge({ apikey: 'abc123xyz000', onSave: function(arg){ //the passed `arg` has the following methods: toImages, toDataURLs, toBlobs //all returning array of images in the requested format arg.toImages().forEach(img => document.body.appendChild(img)); } }).edit([ //user will edit only this image and all changes will be replicated to the rest 'http://yourdomain.com/path/to/image1.jpg', 'http://yourdomain.com/path/to/image2.jpg', 'http://yourdomain.com/path/to/imageN.jpg', ]); </script>
Check the video above for more detailed example, or refer to our documentation.
Availability
Batch editing is a Premium feature, and is available in all Premium packages, and of course in the 30-day free trial. FREE package does not support batch editing.
Charges
You will be charged as a single image for the whole batch. No matter how big the batch is – 2, 5, 10, 100 – saved images counter will be increased only by 1.
Multiple editing
Together with the Batch editing Pixo now supports Multiple editing. Before you were able to edit a single image per session. Now, you can pass multiple images to the edit method as arguments, and they will be edited one after another, in a single session. You are also able to combine multiple editing with batches:
<script src="https://pixoeditor.com/editor/scripts/bridge.m.js"></script> <script> new Pixo.Bridge({ apikey: 'abc123xyz000', onSave: function(arg1, arg2, arg3){ document.body.appendChild(arg1.toImage()); document.body.appendChild(arg2.toImage()); document.body.appendChild(arg3.toImage()); //or better [].slice.call(arguments).forEach(arg => document.body.appendChild(arg.toImage())); } }).edit( //user will edit every image one after another 'http://yourdomain.com/path/to/image1.jpg', 'http://yourdomain.com/path/to/image2.jpg', 'http://yourdomain.com/path/to/imageN.jpg' ); </script>
Check the video above for more detailed example, or refer to our documentation.