Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Which PHP Image function to use?

Status
Not open for further replies.

Bastien

Programmer
May 29, 2000
1,683
0
0
CA
Hi All,

I am wondering what function to use. I need to open an image (likely TIFF format) and read one line of pixels from an area near the top of the page (Its a barcode reader for faxes) and examine that 'string' of pixels for the color...

Just unsure how to best approach this.

TIA



Bastien

Cat, the other other white meat
 
hmmm, just quickly having a think while looking at the ol' doumentation I would suggest opening the image using imagecreatefromjpeg ( function.
Then use imagecopy ( function to copy a single line of pixels from that orginal in a second temporary image.
Finally, use imagecolorat ( function in a for loop to effectively scan across your newly created cross section.

I would produce some sample code for you but its getting late. This should at least point you in the right direction

If it aint broke, redesign it!
 
Thanks, I had thought of the image copy and the imagecolorat functions, it was the first I was puzzling over

This'll get me started..

Bastien

Cat, the other other white meat
 
ps. if you generate truecolor images, use the imagecreatetruecolor(), or you will see that your images become grey-ish!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top