Solved

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

Posted on 2001-09-04
7
185 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this Micro Tutorial viewers will learn how to remove an unwanted object using Photoshop’s feature known as content-aware fill.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Suggested Courses
Course of the Month7 days, 7 hours left to enroll

622 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