Solved

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

Posted on 2001-09-04
7
178 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 34

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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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 34

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
RGB code colors 8 108
Delphi - replicating a form 8 86
Any free software for printscreens 7 97
Tvertscrollbox like a whatsapp layout delete messages 1 24
Keep your audience engaged and get the most out of your next presentation with these quick Prezi tips.
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
In this second Micro Tutorial in the series,  viewers will learn more basic shortcuts and functions of Illustrator. In this tutorial you will learn about the eyedropper tool, zoom , ellipses and more.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

820 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