ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Flip horizontal
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

pierrotsc

USA
497 Posts

Posted - Mar 09 2018 :  09:53:58  Show Profile  Reply
When you load a 16 bit image and flip it horizontally, the image becomes black.
Best
Pierre

attach/pierrotsc/20183995351_16bitDONE-arrow.zip
33.99 KB

w2m

USA
1990 Posts

Posted - Mar 12 2018 :  10:06:42  Show Profile  Reply
Your image contains layers so flip is not working. If you load the image without layers the image is flipped correctly and is not all black:

{ Change PSD_LoadLayers to False to load the base image without layers }
{ Call this before loading the image }
ImageEnView1.IO.ParamsFromFile(AFilename);
if ImageEnView1.IO.Params.FileType = ioPSD then
begin
  ImageEnView1.IO.Params.PSD_LoadLayers := False;
  ImageEnView1.IO.LoadFromFilePSD(AFilename);
  ImageEnView1.Proc.Flip(fdHorizontal);
end;

if PSD_LoadLayers is true and the image is flipped, the image is not flipped and the arrow remains visible and is not black.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Mar 12 2018 :  10:09:18  Show Profile  Reply
When i open the file in Photoshop, it only has one layer.
I will check your code to see if it fixes the issue.
Thanks
Go to Top of Page

w2m

USA
1990 Posts

Posted - Mar 12 2018 :  10:11:55  Show Profile  Reply
If it does not work for you then you have some code that is causing the problem because it works here.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Mar 12 2018 :  10:17:11  Show Profile  Reply
You are indeed correct. I loaded it with photoen3 and it worked but i used another onlime demo last and it did not. So i guess It is a code issue.
Thanks for testing.
Appreciate it.
Pierre
Go to Top of Page

w2m

USA
1990 Posts

Posted - Mar 12 2018 :  10:47:59  Show Profile  Reply
Here is a demo that flips psd.

attach/w2m/201831210463_MultiframePSD.zip
102.26 KB
In this example your file is opened and PSD_LoadLayers is True and the image can be flipped. When loading psd files with layers, the selected layer is flipped.
Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Mar 12 2018 :  10:59:22  Show Profile  Reply
Thank you very much..Let me load it..
Best
Go to Top of Page

w2m

USA
1990 Posts

Posted - Mar 12 2018 :  11:03:03  Show Profile  Reply
Change the delete button code to this:
procedure TForm1.Delete1Click(Sender: TObject);
{ Delete the selected layer. }
begin
  ImageEnView1.LayersRemove(ImageEnMView1.SelectedImage);
  ImageEnMView1.DeleteSelectedImages;
  ImageEnView1.Bitmap.Modified := True;
  UpdateGUI;
  UpdateStatusbar;
end;

This demo flips the selected layer.
This demo is not fully tested. There may be other code that needs modification.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Mar 12 2018 :  11:12:43  Show Profile  Reply
no problem..
Go to Top of Page

w2m

USA
1990 Posts

Posted - Mar 12 2018 :  11:13:13  Show Profile  Reply
All ImageEn proc methods operate on the selected layer including ImageEnView1.Proc.Flip(fdHorizontal);

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

xequte

38222 Posts

Posted - Mar 12 2018 :  14:55:55  Show Profile  Reply
Thanks Bill

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Mar 12 2018 :  15:52:25  Show Profile  Reply
Ok,i was able to duplicate it.
Add that
ImageEnView1.IO.NativePixelFormat := true;

Then when you flip, it becomes black..
Go to Top of Page

xequte

38222 Posts

Posted - Mar 12 2018 :  20:38:44  Show Profile  Reply
Hi

We are investigating...

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

w2m

USA
1990 Posts

Posted - Mar 13 2018 :  10:41:36  Show Profile  Reply
Nigel,

I reviewed and updated the demo for your testing if you wish. I added a checkbox to toggle NativePixelFormat.
attach/w2m/2018313104128_MultiframePSD.zip
59.98 KB

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Mar 13 2018 :  11:17:46  Show Profile  Reply
If you check the box, then open an image (16 bit), i get the program to crash..
Thanks
Go to Top of Page

w2m

USA
1990 Posts

Posted - Mar 13 2018 :  11:36:23  Show Profile  Reply
Yes, i know. That's why I sent it to Nigel to look at. Rarely do I work with NativePixelFormat except for special circumstance in just a few projects. I do not to think you can not apply proc functions to 16 bit NativePixelFormat images according to the help file shown below because use of NativePixelFormat will prevent execution of some image processing operations:

property NativePixelFormat: Boolean;

Description

By default, ImageEn converts all paletted images to 24 bit (true color). Only black/white images are stored in the original format with 1 bit per pixel.
Setting NativePixelFormat to True disables the conversion and uses the image's native format.

Notes:
- Use of NativePixelFormat will prevent execution of some image processing operations
- Setting ImageEnView1.IO.NativePixelFormat is the same as setting ImageEnView1.IO.Params.NativePixelFormat
- LegacyBitmap must be False to enable NativePixelFormat

If the help file is correct and I believe it is, then Nigel will have to come up with a way to achieve this.

I also do not understand why the demo shows RGB48-bit when your 16 bit image is loaded. This does not make sence to me.
if ImageEnView1.IO.Params.BitsPerSample *
ImageEnView1.IO.Params.SamplesPerPixel = 32 then
StatusBar1.Panels[4].Text := 'Colors: RGBA-32Bit'
else
StatusBar1.Panels[4].Text := 'Colors: RGB-' +
IntToStr(ImageEnView1.IO.Params.BitsPerSample *
ImageEnView1.IO.Params.SamplesPerPixel) + 'Bit';

The above code should return RGB16-bit but it returns RGB48-bit with your image.
Did you create your image with ImageEn and is it truly 16 bit?

Bill Miller
Adirondack Software & Graphics[/b]
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Mar 13 2018 :  11:38:48  Show Profile  Reply
That is true..it does show 48 bit in the preview. I guess it is 3x16 per channels.
It was created from scratch in Photoshop. I could also upload one of my raw 16 bit image but it also show 48 bit.
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Mar 13 2018 :  14:44:32  Show Profile  Reply
I am attaching a photo I shot of my daughter in law. It came from a raw image and it is 16 bit. That may help you.
Best

attach/pierrotsc/201831314444_liz.zip
1797.85 KB
Go to Top of Page

xequte

38222 Posts

Posted - Mar 22 2018 :  19:03:42  Show Profile  Reply
Hi

We've added flipping support for all pixel formats in the coming update. You can email me for a pre-release.


Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: