Buggy code:
public final class AWTImageTools { private AWTImageTools ( ) { } public static BufferedImage constructImage ( final int c , final int type , final int w , final int h , final boolean interleaved , final boolean banded , final DataBuffer buffer ) { } public static BufferedImage drawHistogram ( final long [ ] hist , final int height ) { } public static BufferedImage drawHistogram ( final long [ ] hist , final int width , final int height , final long max , final boolean log ) { } public static BufferedImage makeTextBufferedImage ( final String text , final int width , final int height , final String lineDelimiter ) { } public static BufferedImage makeSubtitledBufferedImage ( final BufferedImage source , final String txt ) { } public static < T extends RealType < T > > JFrame showInFrame ( final Img < T > img , final String title ) { } public static < T extends RealType < T > > JFrame showInFrame ( final Img < T > img , final String title , final double factor ) { } public static < T extends RealType < T > , I extends Img < T > > JFrame showInFrame ( final I img , final int dimX , final int dimY , final long [ ] pos , String title , final double factor ) { } public static void showInFrame ( final Image img ) { } public static void showInFrame ( final Image img , String title , final double factor ) { } public static < L > void showInFrame ( final RandomAccessibleInterval < LabelingType < L > > lab , String title ) { } public static < T extends Type < T > > BufferedImage renderScaledStandardColorImg ( RandomAccessibleInterval < T > img , final ImageRenderer < T > renderer , final double factor , final long [ ] startPos ) { long width ; long height ; FinalInterval interval ; AffineGet transform ; long [ ] min = new long [ img . numDimensions ( ) ] ; img . min ( min ) ; if ( ( img . numDimensions ( ) ) == 1 ) { width = ( min [ 0 ] ) + ( Math . max ( 1 , ( ( int ) ( ( img . dimension ( 0 ) ) * factor ) ) ) ) ; transform = new AffineTransform2D ( ) ; ( ( AffineTransform2D ) ( transform ) ) . scale ( factor ) ; interval = new FinalInterval ( new long [ ] { min [ 0 ] , 0 } , new long [ ] { width - 1 , 0 } ) ; img = MiscViews . synchronizeDimensionality ( img , interval ) ; } else if ( ( img . numDimensions ( ) ) == 2 ) { width = ( min [ 0 ] ) + ( Math . max ( 1 , ( ( int ) ( ( img . dimension ( 0 ) ) * factor ) ) ) ) ; height = ( min [ 1 ] ) + ( Math . max ( 1 , ( ( int ) ( ( img . dimension ( 1 ) ) * factor ) ) ) ) ; transform = new AffineTransform2D ( ) ; ( ( AffineTransform2D ) ( transform ) ) . scale ( factor ) ; interval = new FinalInterval ( min , new long [ ] { width - 1 , height - 1 } ) ; } else if ( ( img . numDimensions ( ) ) == 3 ) { width = ( min [ 0 ] ) + ( Math . max ( 1 , ( ( int ) ( ( img . dimension ( 0 ) ) * factor ) ) ) ) ; height = ( min [ 1 ] ) + ( Math . max ( 1 , ( ( int ) ( ( img . dimension ( 1 ) ) * factor ) ) ) ) ; transform = new AffineTransform3D ( ) ; ( ( AffineTransform3D ) ( transform ) ) . set ( factor , 0.0 , 0.0 , 0.0 , 0.0 , factor , 0.0 , 0.0 , 0.0 , 0.0 , 1.0 , 0.0 ) ; <START_BUG> interval = new FinalInterval ( min , new long [ ] { width , height , img . dimension ( 2 ) } ) ; <END_BUG> } else { throw new IllegalArgumentException ( "Images<seq2seq4repair_space>with<seq2seq4repair_space>more<seq2seq4repair_space>than<seq2seq4repair_space>3<seq2seq4repair_space>dimensions<seq2seq4repair_space>are<seq2seq4repair_space>not<seq2seq4repair_space>supported!" ) ; } return AWTImageTools . makeBuffered ( renderer . render ( Views . interval ( RealViews . affine ( Views . interpolate ( Views . extend ( img , new net . imglib2 . outofbounds . OutOfBoundsBorderFactory < T , RandomAccessibleInterval < T > > ( ) ) , new net . imglib2 . interpolation . randomaccess . NearestNeighborInterpolatorFactory < T > ( ) ) , transform ) , interval ) , 0 , 1 , startPos ) . image ( ) ) ; } protected static final Component OBS = new Container ( ) ; public static BufferedImage makeBuffered ( final Image image ) { } public static BufferedImage makeBuffered ( final Image image , final ColorModel cm ) { } public static boolean loadImage ( final Image image ) { } }

Fix:
interval = new FinalInterval ( min , new long [ ] { width , height , img . max ( 2 ) } ) ;