• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 

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

76
Thanks for the contribution, will be included for the next release :)
77
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?
78
Bugs And Other Insects / Re: Two small bugs
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.
79
Help & Questions / Re: JPG Resolution
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) Select
type
  // defined in Imaging.pas
  TResolutionUnit = (
    ruSizeInMicroMeters, // value is pixel size in micrometers
    ruDpi,               // value is pixels/dots per inch
    ruDpm,               // value is pixels/dots per meter
    ruDpcm               // value is pixels/dots per centimeter
  );

var
  XRes, YRes: Single;
  ResUnit: TResolutionUnit;

... load image ...

ResUnit := ruDpi;
if GlobalMetadata.GetPhysicalPixelSize(ResUnit, XRes, YRes) then
begin
  ... print resolution present, do something with it
end;

... do something with image
GlobalMetadata.SetPhysicalPixelSize(ResUnit, XRes, YRes, True)
... save image


Checkout TMetadata class in Imaging.pas for implementation details.
80
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) Select
//Palette := @ImageData.Palette;  wrong
Palette := ImageData.Palette; // ok
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) Select
ReduceColors(ImageData, NumberOfColors);
ConvertImage(ImageData, ifIndex8); // added
Palette := ImageData.Palette;


Now the colors are counted correctly.
81
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).
82
Help & Questions / Re: Delphi XE2 32/64
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.
83
Here's page where the link points to: http://sourceforge.net/donate/index.php?group_id=125626  :)
84
Ok I'll let you know when HDR/RGBE file format support is ready.
What software do you use for working with HDR imagery?
85
You can find a link to donations at Imaging's homepage http://imaginglib.sourceforge.net/ (in right column). Thanks!
86
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) .

87
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.
88
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.
89
News & Announcements / Re: Next update info: 0.80
1 September 2011, 19:13:24
Hi, yes it's still updated, but the progress is slower than it used to be.
Right now I'm making compatibility changes in Imaging for new Delphi (to target Win64 and MacOSX  ;))
90
Help & Questions / Re: Can't use Library in FPC
22 August 2011, 03:26:23
What exactly is the problem?
You need to pass paths to the library folders to compiler.
Checkout section Using Library/Install and Compile in Imaging's documentation for FPC compiler setup.
SMF spam blocked by CleanTalk