Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Galfar

Pages: 1 2 3 [4] 5 6 7 ... 24
46
Look's like it is GTK2 interface or LCL RawImage related issue when converting
from LCL bitmap back to Imaging's image.
Just installed x64 Linux and started debugging...

Btw: Are you using classes from ImagingComponents unit just for saving?

47
Help & Questions / Re: TIFF
« on: 12 December 2011, 00:19:55 »
TIFF tags writer was update long ago,
but it probably won't work in MS Doc Imaging
anyway due to the bug in MS Doc described previously.

48
Thanks for the contribution, will be included for the next release :)

49
Hello,

Did this work before you downloaded "working"?

Could you try ifA8R8G8B8 instead of ifA32R32G32B32F in the conversion?

What file formats have you loaded from/saved to?

50
Bugs And Other Insects / Re: Two small bugs
« on: 1 November 2011, 23:50:04 »
Thanks for the report, working versions are not always tested in all Delphi versions :(
I'll update the repository with a fix in a short while.

51
Help & Questions / Re: JPG Resolution
« on: 1 November 2011, 23:33:33 »
You can get print resolution from JPEGs (provided that this info is embedded inside) using metadata framework.
It's not stored in image itself so you need to keep track of it if you want to later save the values that were loaded.

Code: Pascal
  1. type
  2.   // defined in Imaging.pas
  3.   TResolutionUnit = (
  4.     ruSizeInMicroMeters, // value is pixel size in micrometers
  5.     ruDpi,               // value is pixels/dots per inch
  6.     ruDpm,               // value is pixels/dots per meter
  7.     ruDpcm               // value is pixels/dots per centimeter
  8.   );
  9.  
  10. var
  11.   XRes, YRes: Single;
  12.   ResUnit: TResolutionUnit;
  13.  
  14. ... load image ...
  15.  
  16. ResUnit := ruDpi;
  17. if GlobalMetadata.GetPhysicalPixelSize(ResUnit, XRes, YRes) then
  18. begin
  19.   ... print resolution present, do something with it
  20. end;
  21.  
  22. ... do something with image
  23. GlobalMetadata.SetPhysicalPixelSize(ResUnit, XRes, YRes, True)
  24. ... save image

Checkout TMetadata class in Imaging.pas for implementation details.

52
Help & Questions / Re: Having problems with FindColor()
« on: 1 November 2011, 00:22:26 »
Hi, sorry for late answer.

There are two problems with your code:

1) Your setting Palette variable to point to the address of ImageData.Palette field, not to the actual
palette info. Correct way is this:
Code: Pascal
  1. //Palette := @ImageData.Palette;  wrong
  2. Palette := ImageData.Palette; // ok
  3. Palette := @ImageData.Palette[0]; // also ok, if ImageData.Palette <> nil

2) When you fix the palette pointer problem you'll notice you get 'Access violation' exception now. That's because
ImageData.Palette = nil. ReduceColors keeps the image in its original data format and doesn't convert it to indexed (that's because ReduceColors supports color counts up to 4096 for which there is no indexed format).
In short, you need to convert to indexed format explicitly by adding ConvertImage call after ReduceColors:
Code: Pascal
  1. ReduceColors(ImageData, NumberOfColors);
  2. ConvertImage(ImageData, ifIndex8); // added
  3. Palette := ImageData.Palette;

Now the colors are counted correctly.

53
Thanks for the link to test images.
HDR loading in Imaging is working now, I'll test it with few more exotic images and update the repository.
Saving will be done a little later.
HDR can store gamma and exposure value in the file, these are read by Imaging as well and accessible
trough the new metadata support class (though any of the PhotoShop HDRs doesn't have this defined).

54
Help & Questions / Re: Delphi XE2 32/64
« on: 30 September 2011, 01:33:18 »
Hi, XE2 support is already done and uploaded to repository.
What's currently supported: Win64 target compatibility, OSX target compatibility, FireMonkey bitmap converter.

55
Suggestions, Feature Requests, Contributions / Re: Donation?
« on: 29 September 2011, 09:38:51 »
Here's page where the link points to: http://sourceforge.net/donate/index.php?group_id=125626  :)

56
Suggestions, Feature Requests, Contributions / Re: .EXR format request
« on: 26 September 2011, 13:12:04 »
Ok I'll let you know when HDR/RGBE file format support is ready.
What software do you use for working with HDR imagery?

57
Suggestions, Feature Requests, Contributions / Re: Donation?
« on: 26 September 2011, 13:04:50 »
You can find a link to donations at Imaging's homepage http://imaginglib.sourceforge.net/ (in right column). Thanks!

58
Suggestions, Feature Requests, Contributions / Re: .EXR format request
« on: 24 September 2011, 02:50:31 »
Hi, I thought of supporting OpenEXR several years ago but it seems nearly impossible: it's quite complex format and only thing that supports it
completely is OpenEXR library from ILM. Library is too big to translate it to Pascal and since it's interface is in C++ it cannot even be linked to
Pascal program (libraries in plain C can be used quite easily). One solution would be to write DLL in C++/C that will provide simple interface for Imaging.

HalfFloat image formats have been supported by Imaging for several years (if you look in ImagingFormats.pas you'll find this exact FloatToHalf
function there  ;)).

Formats that currently support floating point images in Imaging apart from Delphi only TIFF are DDS, PFM/PAM, and PSD (I'll be adding HDR/RGBE format) .


59
This is the difference between VCL demo and LCL demo - the conversion has both R8G8B8 and A8R8G8B8 images in the memory at the same time. VCL demo only converts images incompatible with canvas class so for R8G8B8 input no conversion is needed - thus it uses nearly half the memory of LCL demo.
In VampConvert if you just resave to another format no conversion is needed so again it's half the memory usage of LCL imager.

Determining the memory limit is not so easy, even if you have 1GB free and try to allocate 500MB it can still fail due to memory
fragmenation.

Imaging can work with these large images provided that you have a lot of RAM and use 64 bit compiler. I just tried loading 20000x20000 R8G8B8 image and it opened ok in VCL demo. Memory mapping and using tiled images would work (probably what Photoshop itself uses when working with these large images) when the memory needed to hold the images is bigger than installed RAM but that's quite a lot of work.

60
How much RAM does your computer have installed?
This image should take up ~300MB of memory.
Since it works in Delphi app maybe it's some problem with memory manager used by FPC
(cannot allocate continuous mem block of that size).

Could you try saving that image in some other file format and try to open it in LCLImager? To see
if this problem is tied to PSD loader or the whole LCL/FPC app.

Pages: 1 2 3 [4] 5 6 7 ... 24