@Override public void paint( Graphics g ) {
		if( hdrImage == null ) {
			g.setColor(Color.BLACK);
			g.fillRect(0, 0, getWidth(), getHeight());
		} else {
			int scale = 2;
			while( hdrImage.getWidth()*scale <= getWidth() && hdrImage.getHeight()*scale <= getHeight() ) {
				++scale;
			}
			--scale;
			
			int left  = (getWidth()  - hdrImage.getWidth() *scale) / 2;
			int top   = (getHeight() - hdrImage.getHeight()*scale) / 2;
			int right = hdrImage.getWidth() *scale + left;
			int bottom= hdrImage.getHeight()*scale + top  ;
			
			g.setColor(Color.BLACK);
			g.fillRect(0, 0, left, getHeight());
			g.fillRect(right, 0, getWidth()-right, getHeight());
			g.fillRect(left, 0, right - left, top);
			g.fillRect(left, bottom, right - left, getHeight() - bottom);
			
			g.drawImage(bImg, left, top, left+hdrImage.getWidth()*scale, top+hdrImage.getHeight()*scale, 0, 0, hdrImage.getWidth(), hdrImage.getHeight(), null);
		}

		int line = 1;
		
		if( overlayTextMode >= 1 ) {
			g.setColor(Color.WHITE);
			g.drawString(String.format("Exposure: %12.4f", exposure), 4, 16*line++ );
			g.drawString(String.format("Gamma:    %12.4f", gamma   ), 4, 16*line++ );
			g.drawString("Dithering: " +(dither ? "enabled" : "disabled"), 4, 16*line++ );
			
			if( extraStatusLines.length > 0 ) {
				++line;
				for( String text : extraStatusLines ) {
					g.drawString(text, 4, 16*line++ );
				}
			}
		}
		
		if( overlayTextMode == 1 ) {
			g.drawString("Hit F1 for help", 4, 16*line++ );
		}
		
		if( overlayTextMode >= 2 ) {
			++line;
			g.drawString("Keys:", 4, 16*line++);
			g.drawString("  F1 - toggle overlay text", 4, 16*line++);
			g.drawString("  X  - export image", 4, 16*line++);
			g.drawString("  E  - change exposure", 4, 16*line++);
			g.drawString("  G  - change gamma", 4, 16*line++);
			g.drawString("Hold shift to decrease exposure/gamma", 4, 16*line++);
			g.drawString("Hold control to change values more slowly", 4, 16*line++);
		}
	}