[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Function BYTSCL



Steffen Kernchen wrote:
> 
> > Of course you can do by hand something similar what bytscl does:
> >
> > lets say your array is 'a'
> >
> > minA=min(a,MAX=maxA)
> > a=a-minA
> > a=byte(float(a)/maxA*255)
> >
> > (2nd line is 'optional')
> 
> when I use the 2nd line, then there is no picture displayed!
> if I donīt write this line I see a pic, that is only brighter. There is no
> more contrast.  :(
> 
> > but why you should not use bytarr?
> > Only point I can guess is that you have 8bit color and dont want to
> > use all colors?
> 
> no, itīs an exercise, so that we learn, what BYTSCL does.
> 
> I 've a pic and I read it with READ_BMP to get an array. that array I have
> to transform to get a better contrast.
> but unfortunately without using BYTSCL...  :(
> 
> cheers,
> 
> steffen
Sorry, 2nd and 3rd line should read:

a=a-minA
a=byte(float(a)/(maxA-minA)*255)
                     *****
then it should work.
Its almost the same as bytscl with its default settings.
But strange that you don't see any picture with the old 2nd line.
Probably you just see a very dark one.
Cheers, 
marc