torch / image

An Image toolbox for Torch.
Other
209 stars 141 forks source link

Problem drawing colors #190

Closed Conchylicultor closed 8 years ago

Conchylicultor commented 8 years ago

The colors seems to be binary, only 0 or 255 are accepted. All intermediates values are discarded. Here is a example code to reproduce the issue:

require 'image'

l = image.lena()
l = image.drawText(l, 'test',10,10, {color={0,255,0}}) -- Works (green)
image.display(l)

f = image.lena()
f = image.drawText(f, 'test',10,10, {color={0,0,255}}) -- Works (blue)
image.display(f)

g = image.lena()
g = image.drawText(g, 'test',10,10, {color={254,0,0}}) -- Won't works (black)
image.display(g)
karandwivedi42 commented 8 years ago

I hope this works. https://github.com/torch/image/pull/191