Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

Converting image between RGB and CMYK

images php coding issues or problems here.

Moderators: macek, egami, gesf

Converting image between RGB and CMYK

Postby rikutuominen » Thu Jul 08, 2004 7:15 am

Well I need to make a small script to convert a image.
The need is to have one pic in several sizes and both CMYK and RGB format.

How well does GD2 suite to convert between RGB and CMYK.
What format should I use as the original pic, RGB or CMYK.
The main function would be something like:

imageConvert(image, size_h, format,dpi);

like
newImage = imageConvert(myImage, 300, CMYK,300);

Any tips how to start?
My main point concerns the conversion between RGB or CMYK.

Any help is apreciated. :)
rikutuominen
New php-forum User
New php-forum User
 
Posts: 8
Joined: Fri May 21, 2004 12:30 am

Postby swirlee » Mon Jul 12, 2004 9:11 am

RGB and CMYK aren't image formats, they're different ways to describe color. If you can tell us what format your image is in (e.g. PNG, GIF, JPEG, TIFF), or what format you want it to be in (or why) we might be able to help you.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby rikutuominen » Wed Jul 14, 2004 12:45 pm

Thank you for the clarification. I like to thank you of any possible tips and help I can get. :)

I have used jpg format so far, but I like to also have png as a option if possible.

The case is following. I need to input one base picture lets say
myPic.jpg or myPic.png.
height 777 pixel, resolution 300 dpi, CMYK OR RGB, compression rate 0

Then the script would convert it to four different pics

wwwPic1.jpg
height 300 pixel, resolution 96 dpi, RGB, compression rate 10

wwwPic2.jpg
height 500 pixel, resolution 96 dpi, RGB, compression rate 10

PrintPic.jpg or PrintPic.png
height 777 pixel, resolution 150 dpi, CMYK, compression rate 0

PressPic.jpg or PressPic.png
height 777 pixel, resolution 300 dpi, CMYK, compression rate 0
rikutuominen
New php-forum User
New php-forum User
 
Posts: 8
Joined: Fri May 21, 2004 12:30 am

Postby swirlee » Wed Jul 14, 2004 1:09 pm

For image manipulation, you're going to want to use the GD or Imagick libraries. I believe the latter is better at resizing, but can't say for sure.

Concerning RGB vs. CMYK, this is irrelevant to the image format. You can't save a PNG or JPEG in one format or the other, because the image formats store color data in their own ways. RGB/CMYK is something you're only going to be worrying about when editing or printing the images in an image editing program.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby rikutuominen » Sat Jul 17, 2004 5:10 am

Sure I can save a picture eather RGB or CMYK format when saving to jpg format using graphics applications.
Well I have allready been maintaining a picture library where the each picture been acceable for download. Those pics have been in following format. What I like to do now is instead of having to convert those pics to 4 different formats manually through a graphics application it would be do through a script automatically.

wwwPic1.jpg
height 300 pixel, resolution 96 dpi, RGB, compression rate 10

wwwPic2.jpg
height 500 pixel, resolution 96 dpi, RGB, compression rate 10

PrintPic.jpg
height 777 pixel, resolution 150 dpi, CMYK, compression rate 0

PressPic.jpg
height 777 pixel, resolution 300 dpi, CMYK, compression rate 0

You can see the idea through following www page.
http://www.benchmarking.fi/changemanage ... res/books/
rikutuominen
New php-forum User
New php-forum User
 
Posts: 8
Joined: Fri May 21, 2004 12:30 am

Postby swirlee » Mon Jul 19, 2004 6:47 am

Please read my previous post. The links are correct.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back


Return to PHP coding => Images

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.