Is there a way to merge multiple images to a single image. I have seen merge_image library but it didn't worked. can anyone help with it. All i have is list of image file which I need to merge it as single.
Is there a way to merge multiple images to a single image. I have seen merge_image library but it didn't worked. can anyone help with it. All i have is list of image file which I need to merge it as single.
You can use image_editor
final slideLength = 180.0;
final option = ImageMergeOption(
canvasSize: Size(slideLength * count, slideLength * count),
format: OutputFormat.png(),
);
final memory = await loadFromAsset(R.ASSETS_ICON_PNG);
for (var i = 0; i < count; i++) {
option.addImage(
MergeImageConfig(
image: MemoryImageSource(memory),
position: ImagePosition(
Offset(slideLength * i, slideLength * i),
Size.square(slideLength),
),
),
);
}
for (var i = 0; i < count; i++) {
option.addImage(
MergeImageConfig(
image: MemoryImageSource(memory),
position: ImagePosition(
Offset(
slideLength * count - slideLength * (i + 1), slideLength * i),
Size.square(slideLength),
),
),
);
}
final result = await ImageMerger.mergeToMemory(option: option);
provider = MemoryImage(result);
setState(() {});