[Lazarus] Color thief

2015-07-08 Thread aradeonas
Hi, Today I saw Color thief[1] and I was impressed.I like to have something like this in my application so I reviewed the code but I dont know how to implement this in FreePascal or couldn't find anything like this in Pascal that do as good as this. Any one know about a library like this in

Re: [Lazarus] Color thief

2015-07-08 Thread Michael Van Canneyt
On Wed, 8 Jul 2015, aradeonas wrote: Hi,   Today I saw Color thief and I was impressed.I like to have something like this in my application so I reviewed the code but I dont know how to implement this in FreePascal or couldn't find anything like this in Pascal that do as good as this.   Any

Re: [Lazarus] Color thief

2015-07-08 Thread aradeonas
Thank you. I get exception when try to load from file and I could not debug in FPC source,debugger don't go there: var  i: Integer;  Img: TFPCustomImage;  reader: TFPCustomImageReader; begin  Img := TFPCustomImage.Create(0, 0);  Reader := TFPReaderJPEG.Create; 

Re: [Lazarus] Color thief

2015-07-08 Thread Michael Van Canneyt
On Wed, 8 Jul 2015, aradeonas wrote: Thank you.   I get exception when try to load from file and I could not debug in FPC source,debugger don't go there:   var   i: Integer;   Img: TFPCustomImage;   reader: TFPCustomImageReader; begin   Img := TFPCustomImage.Create(0, 0);   Reader :=

Re: [Lazarus] Color thief

2015-07-08 Thread aradeonas
Project project1 raised exception class 'External: SIGSEGV'. File exists and it is correct. Ara -- http://www.fastmail.com - Email service worth paying for. Try it for free -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org

Re: [Lazarus] Color thief

2015-07-08 Thread aradeonas
Here you are. http://lokeshdhakar.com/projects/color-thief/img/photo1.jpg Ara -- http://www.fastmail.com - The professional email service -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org

Re: [Lazarus] Color thief

2015-07-08 Thread Michael Van Canneyt
On Wed, 8 Jul 2015, Graeme Geldenhuys wrote: On 2015-07-08 22:30, aradeonas wrote: I test the code but app will wait for more than a minute and so on on img.UsePalette := True; and I couldn't get values. It took a while here... just under a minute, but then it started writing out all the

Re: [Lazarus] Color thief

2015-07-08 Thread Graeme Geldenhuys
On 2015-07-08 22:30, aradeonas wrote: I test the code but app will wait for more than a minute and so on on img.UsePalette := True; and I couldn't get values. It took a while here... just under a minute, but then it started writing out all the RGB values. So it works, but it just ain't fast

Re: [Lazarus] Color thief

2015-07-08 Thread aradeonas
My bad! I test the code but app will wait for more than a minute and so on on img.UsePalette := True; and I couldn't get values.I test that image in Lazarus/FPC Trunk 2015/06/27 49452. Regards, Ara -- http://www.fastmail.com - Same, same, but different... --

Re: [Lazarus] Color thief

2015-07-08 Thread Michael Van Canneyt
On Wed, 8 Jul 2015, aradeonas wrote: Project project1 raised exception class 'External: SIGSEGV'.   File exists and it is correct. Can you send me the file ? Michael.-- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org

Re: [Lazarus] Color thief

2015-07-08 Thread Michael Van Canneyt
On Wed, 8 Jul 2015, aradeonas wrote: Here you are. http://lokeshdhakar.com/projects/color-thief/img/photo1.jpg Your program contained an error, I should have seen it at once. You used TFPCustomImage. This is an abstract class. You should have used a descendent like TFPMemoryImage instead.

Re: [Lazarus] Color thief

2015-07-08 Thread aradeonas
So in my case BGRABitmap is a better choice,because I could choose color count. Thank you Michael and Graeme as always. Regards, Ara -- http://www.fastmail.com - Faster than the air-speed velocity of an unladen european swallow --

Re: [Lazarus] Color thief

2015-07-08 Thread aradeonas
For now I used lovely BGRABitmap like this,thanks to its author circular. uses BGRABitmap, BGRABitmapTypes, BGRAColorQuantization; var  bmp:TBGRABitmap;  quant: TBGRAColorQuantizer;  i: Integer; begin bmp:=TBGRABitmap.Create('E:\photo1.jpg');  quant := TBGRAColorQuantizer.Create(bmp,