Solved

how i can access data on JPEG,BMP,PSD etc

Posted on 2001-09-04
7
177 Views
Last Modified: 2013-11-19
hiii
can you help me
i want to access image's data with format JPEG,GIF etc
i don't use Timage to access it
but i just want get row,column,pixel's data and colors
from that images
0
Comment
Question by:all_rays
7 Comments
 
LVL 1

Expert Comment

by:Phoenix_s
ID: 6454897
each of those file types tends to have its own internal structure for deriving image size, color depth, palette (if indexed color scheme)

perhaps some kind of multiple format image component will be of use to you.

0
 
LVL 33

Expert Comment

by:Slick812
ID: 6455449
if you want each pixel's color data, you may need to use scanline and you'll have to convert the formats to a bitmap. The .jpeg, .gif ect pics are compressed and don't have a per pixel color reference like a bitmap. To display a gif or jpeg image, I think it is DEcompressed into a bitmap type with color info for each pixel. You seem to be looing for a one size fits all pic formats, I never heard of anything like that.
0
 
LVL 6

Expert Comment

by:DrDelphi
ID: 6455505
Hmmm... sounds to me like you might be trying to decipher the format of the file without rendering it. You might try this URL for file formats:

http://www.wotsit.org/search.asp?s=graphics 


Good luck!!
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 27

Expert Comment

by:kretzschmar
ID: 6455514
see also graphicEX library
at
www.lischke-online.de
0
 

Author Comment

by:all_rays
ID: 6475246
can you tell me how i can use scanline
cause i have been try it but i failed
i hope you give me source code of scanline
thanks
0
 
LVL 33

Accepted Solution

by:
Slick812 earned 100 total points
ID: 6475697
there are several ways to use scanline, depending on the color depth of the bitmap (1bit, 4bit, 8bit, 24bit) and the variables you use for the colorbyte output. I like to use this TRGBArray for the scanline color output

TYPE
  pRGBArray = ^TRGBArray;
  TRGBArray = ARRAY[0..16383] OF TRGBTriple;

here is some code which is a simple "lightening" of a bitmap image, this is for 24 bit images, you will need diferent TRGBArray variables for 8bit, 4 bit and 1bit, because they have less data (8bit, 4bit and 1bit) in their color arrays


var
y,x,R,G,B: Integer;
PntCol, PntCol2 : pRGBArray;
Bitmap1, Bitmap2 : TBitmap;


 Bitmap1.LoadFromFile('C:\pics\Dark.bmp');
 Bitmap1.PixelFormat := pf24bit;
 Bitmap2 := TBitmap.Create;
 Bitmap2.Width := Bitmap1.Width;
 Bitmap2.Height := Bitmap1.Height;
 Bitmap2.PixelFormat := pf24bit;

for y := 0 to Bitmap1.Height -1 do
      begin {scan height}
      PntCol := Bitmap1.ScanLine[y];
      PntCol2 := Bitmap2.ScanLine[y];
      for x := 0 to Bitmap1.Width -1 do
        begin {scan Width}
        with PntCol[x] do
        begin
  {this gets the color from Bitmap1}
        R := rgbtRed;
        G := rgbtGreen;
        B := rgbtBlue;
        end;
          Inc(R,34);
  {this increases the color value by 34}
          if R > 255 then R := 255;
  {color values over 255 or less than 0 will not work}
          Inc(G,34);
          if G > 255 then G := 255;
          Inc(B,34);
          if B > 255 then B := 255;
        with PntCol2[x] do
        begin
  {this sets the color in Bitmap2}
        rgbtRed := R;
        rgbtGreen := G;
        rgbtBlue := B;
        end;
        end; {scan width}
      end; {scan height}



 - - - - - - - - - - - - -
this will lighten the Bitmap2 image by 34, hope this helps you. I think scanline is difficult for everyone at first.
0
 
LVL 17

Expert Comment

by:geobul
ID: 9295326
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

accept Slick812's comment as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thanks,

geobul
EE Cleanup Volunteer
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi XE10 Round Image 2 126
File conversion question 5 103
Tviruailstringtree sort multi columns on header click 1 62
firemonkey keyboard covers the controls 1 25
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this Micro Tutorial viewers will learn how to remove an unwanted object using Photoshop’s feature known as content-aware fill.
It’s easy to embed any of your public Prezi presentations on your website or social network to share with others. Learn how simple it is in this tutorial.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question