Posted by
Michael Schmid on
URL: http://imagej.273.s1.nabble.com/Drawing-Text-Rois-tp5013813p5013814.html
Hi Greg,
(1) The drawing color for text is the current foreground color. You can modify it:
Toolbar.setForegroundColor(java.awt.Color.WHITE);
The foreground color value will be converted to a pixel value. Thus, if you change the range of pixel values mapped to the grayscale range between black and white (setMinAndMax of the ImageProcessor or Brightness&Contrast panel), the text may become gray.
(2) For higher resolution, enlarge the image to a larger size, then draw with a larger font.
For use inside ImageJ, i.e., if you do not need to export the image, it is easier to use an overlay instead of drawing the pixels. The overlay scales with the image and the text will always look nice.
Michael
________________________________________________________________
On Jul 30, 2015, at 14:11, Greg wrote:
> Hi,
>
> I want to draw some text on an image. Right now I do:
>
> TR = TextRoi(0,0,'text')
> TR.setStrokeColor(Color.white);
> TR.setNonScalable(True);
> TR.drawPixels(ip)
>
> where ip is of type ShortProcessor. First of all, the text gets displayed in
> black, which is bad because we have a dark background. I also tried
> ip.drawRoi(TR), the text color just wont change. So how do I display 'text'
> in white ?
>
> Secondly, I actually try to annotate little image crops which are only 80x80
> in pixel size. Is there a way to have a better resolution for the displayed
> text as the ImageProcessor natively has? The annotation looks pretty 80's
> style right now..
>
> Regards,
> Greg
>
>
>
>
> --
> View this message in context:
http://imagej.1557.x6.nabble.com/Drawing-Text-Rois-tp5013813.html> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html