I'm not sure that this is necessarily a good idea. ImageLib, FloodFill and dzImage are really drawing libraries. ImageEdit is really for photo manipulation. I feel that these are two quite distinct activities. The drawing libraries work internally directly with 8 bit unsigned gamma corrected colour values, my ImageEdit works internally with 15 bit signed linear colour values - conceptually the two don't really mix.a merge of agraham's, dzt's libraries (including agraham's FloodFillLib) with the ImageLib and the Form drawing functions to have all the image processing and drawing functions in THE ImageLib
I'll be adding a few more things appropriate to photo work - Undo, Crop, Rotate and possibly Resize. I might possibly add some colour/hue manipulation but I need to experiment with how to present that. Any other suggestions welcome.
MyImage = "C:\Temp\test.jpg"
Image1.LoadPicture(MyImage)
Image1.Visible= True
DoEvents
' this initialises a couple of internal gamma lookup tables assuming gamma of 2.2
ImageEdit.New1
' load the image into internal buffers and linarise it to signed 15 bit colour values
' this takes out the gamma correction and allows for a measure of underflow recovery.
' doing processing on gamma corrected images can cause unwanted colour shifts
' doing processing on 8bit values can cause colour banding and blocking due to lost resolution
' ImEd.SetIpGamma(1.8) ' default after New1 is 2.2
' ImEd.SetOpGamma(1.89) ' default after New1 is 2.2
ImageEdit.LoadImage(Image1.Image)
'ImEd.UndoSave
'ImEd.Brightness(-20) ' adjust brightness from -100% to 100%, 0 is unchanged
'ImEd.Brightness(20) ' because we are signed internally this brings the image back from underflow
'ImEd.Contrast(120) ' adjust contrast from -100% to x00% where 100% is unchanged
'ImEd.Saturation(-50) ' adjust saturation as a percentage -100 is gray 0 is unchanged +110 is 10% increase
'ImEd.Hue(90,110,110)' adjust hue by altering each colour Hue(R, G, B) by the given percentage
'ImEd.GrayScale ' make the image grayscale - note it is still a 3 colour image
'ImEd.InvertImage ' invert the colour values of the image
'ImEd.RotateLeft
'ImEd.RotateRight
'ImEd.Mirror
'ImEd.Flip
'ImEd.Crop(52,48,168,220)
ImageEdit.resize(320,240)
Image1.Image = ImageEdit.GetImage("c") ' R, G, B for colour channels, L for luminance, full colour for anything else
ImageEdit.SaveImage(MyImage,"J") ' J - jpg, B - bmp, G - gif, P - png, anything else - jpg
I can't do anything about that, it's a .NET Bitmap object feature. See http://www.b4x.com/forum/questions-help-needed/3317-image-locking.html#post18740ran into an issue when i tried to save the edited image into the original file:
I have added the facility to the BitmapEx to dispose of the actual .NET bitmap while keeping the Basic4ppc BitmapEx object using BitmapEx.Release.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?