Solved

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

Posted on 2001-09-04
7
176 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
see also graphicEX library
at
www.lischke-online.de
0
 

Author Comment

by:all_rays
Comment Utility
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
Comment Utility
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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
In this Micro Tutorial viewers will learn the basic shortcuts and functions in InDesign.
Learn how to use the remote presentation tool in Prezi to allow you to harness the power of this cloud based presentation platform. You can show your presentation with a remote audience using this free tool.

728 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now