docs: private void convertSup(int index, int displayNum, int displayMax,
  			boolean skipScaling) throws CoreException {
  		int w, h;
  		SubPicture subPic = subtitleStream.getSubPicture(index);
  
  		// synchronized (semaphore)
  		{
  			subtitleStream.decode(index);
  			w = subPic.getImageWidth();
  			h = subPic.getImageHeight();
  			OutputMode outputMode = configuration.getOutputMode();
  			if (outputMode == OutputMode.VOBSUB
  					|| outputMode == OutputMode.SUPIFO) {
  				determineFramePal(index);
  			}
  			updateTrgPic(index);
  		}
  		SubPicture picTrg = subPictures[index];
  		picTrg.setWasDecoded(true);
  
  		int trgWidth = picTrg.getImageWidth();
  		int trgHeight = picTrg.getImageHeight();
  		if (trgWidth < MIN_IMAGE_DIMENSION || trgHeight < MIN_IMAGE_DIMENSION
  				|| w < MIN_IMAGE_DIMENSION || h < MIN_IMAGE_DIMENSION) {
  			// don't scale to avoid division by zero in scaling routines
  			trgWidth = w;
  			trgHeight = h;
  		}
  
  		if (!skipScaling) {
  			ResampleFilter f;
  			switch (configuration.getScalingFilter()) {
  			case BELL:
  				f = getBellFilter();
  				break;
  			case BICUBIC:
  				f = getBiCubicFilter();
  				break;
  			case BICUBIC_SPLINE:
  				f = getBSplineFilter();
  				break;
  			case HERMITE:
  				f = getHermiteFilter();
  				break;
  			case LANCZOS3:
  				f = getLanczos3Filter();
  				break;
  			case TRIANGLE:
  				f = getTriangleFilter();
  				break;
  			case MITCHELL:
  				f = getMitchellFilter();
  				break;
  			default:
  				f = null;
  			}
  
  			Bitmap tBm;
  			Palette tPal = trgPal;
  			// create scaled bitmap
  			OutputMode outputMode = configuration.getOutputMode();
  			PaletteMode paletteMode = configuration.getPaletteMode();
  			if (outputMode == OutputMode.VOBSUB
  					|| outputMode == OutputMode.SUPIFO) {
  				// export 4 color palette
  				if (w == trgWidth && h == trgHeight) {
  					// don't scale at all
  					if ((inMode == InputMode.VOBSUB || inMode == InputMode.SUPIFO)
  							&& paletteMode == PaletteMode.KEEP_EXISTING) {
  						tBm = subtitleStream.getBitmap(); // no conversion
  					} else {
  						tBm = subtitleStream.getBitmap()
  								.getBitmapWithNormalizedPalette(
  										subtitleStream.getPalette().getAlpha(),
  										configuration.getAlphaThreshold(),
  										subtitleStream.getPalette().getY(),
  										configuration.getLuminanceThreshold()); // reduce
  																				// palette
  					}
  				} else {
  					// scale up/down
  					if ((inMode == InputMode.VOBSUB || inMode == InputMode.SUPIFO)
  							&& paletteMode == PaletteMode.KEEP_EXISTING) {
  						// keep palette
  						if (f != null) {
  							tBm = subtitleStream.getBitmap().scaleFilter(
  									trgWidth, trgHeight,
  									subtitleStream.getPalette(), f);
  						} else {
  							tBm = subtitleStream.getBitmap().scaleBilinear(
  									trgWidth, trgHeight,
  									subtitleStream.getPalette());
  						}
  					} else {
  						// reduce palette
  						if (f != null) {
  							tBm = subtitleStream.getBitmap().scaleFilterLm(
  									trgWidth, trgHeight,
  									subtitleStream.getPalette(),
  									configuration.getAlphaThreshold(),
  									configuration.getLuminanceThreshold(), f);
  						} else {
  							tBm = subtitleStream.getBitmap().scaleBilinearLm(
  									trgWidth, trgHeight,
  									subtitleStream.getPalette(),
  									configuration.getAlphaThreshold(),
  									configuration.getLuminanceThreshold());
  						}
  					}
  				}
  			} else {
  				// export (up to) 256 color palette
  				tPal = subtitleStream.getPalette();
  				if (w == trgWidth && h == trgHeight) {
  					tBm = subtitleStream.getBitmap(); // no scaling, no
  														// conversion
  				} else {
  					// scale up/down
  					if (paletteMode == PaletteMode.KEEP_EXISTING) {
  						// keep palette
  						if (f != null) {
  							tBm = subtitleStream.getBitmap().scaleFilter(
  									trgWidth, trgHeight,
  									subtitleStream.getPalette(), f);
  						} else {
  							tBm = subtitleStream.getBitmap().scaleBilinear(
  									trgWidth, trgHeight,
  									subtitleStream.getPalette());
  						}
  					} else {
  						// create new palette
  						boolean dither = paletteMode == PaletteMode.CREATE_DITHERED;
  						BitmapWithPalette pb;
  						if (f != null) {
  							pb = subtitleStream.getBitmap().scaleFilter(
  									trgWidth, trgHeight,
  									subtitleStream.getPalette(), f, dither);
  						} else {
  							pb = subtitleStream.getBitmap().scaleBilinear(
  									trgWidth, trgHeight,
  									subtitleStream.getPalette(), dither);
  						}
  						tBm = pb.bitmap;
  						tPal = pb.palette;
  					}
  				}
  			}
  			if (!picTrg.getErasePatch().isEmpty()) {
  				// trgBitmapUnpatched = new Bitmap(tBm);
  				int col = tPal.getIndexOfMostTransparentPaletteEntry();
  				for (ErasePatch ep : picTrg.getErasePatch()) {
  					tBm.fillRectangularWithColorIndex(ep.x, ep.y, ep.width,
  							ep.height, (byte) col);
  				}
  			} else {
  				// trgBitmapUnpatched = tBm;
  			}
  			trgBitmap = tBm;
  			trgPal = tPal;
  
  		}
  	}