How to load an image as ARGB type using Java?



I load an image (.jpg type) using this Java code :
DatasetIOService datasetIOService = context.getService(DatasetIOService.class);
Dataset input =;
and this is by default net.imglib2.type.numeric.integer.UnsignedByteType datatype.
But I need this to be loaded / converted to net.imglib2.type.numeric.ARGBType datatype.
Any ideas on what should be done?
Thanks in advance ! :slight_smile:



Welcome to the forum.

Converters are your friend! Something like:

argbRAI = Converters.convert( ubyteRAI, new RealARGBConverter<T>());

should do the trick. Of course, this is for converting something that’s already been loaded, not for reading an image as ARGB.