Jump to content

CMYK to RGB Conversion


stevesimo

Recommended Posts

Hi, I have a client who wants to upload images to his online shop.  Unfortunately a lot of the images are in CMYK format and he would struggle with converting the images using software ie photoshop.

 

My question is does anyone know of a script which will convert CMYK to RGB format?  Otherwise the only other option I can think of is for him to give me the images and I will convert them for him which is far from ideal.

 

Any advice gladly received

 

Thanks, Steve (Blackpool)

Link to comment
https://forums.phpfreaks.com/topic/49558-cmyk-to-rgb-conversion/
Share on other sites

Imagemagick should be able to help you out. Though its not at all a standard php extension, there is one available Here.

 

Otherwise, you may be lucky enough to have access to it via the shell. Are you on a Linux server? What does...

 

<?php

  echo exec("import -version");

?>

produce?

Hi, I have found a script which might do the conversion

 

$getimagesize = getimagesize($image);

if (  isset($getimagesize['channels']) &&  $getimagesize['channels'] == 4 &&  $getimagesize[2] == IMAGETYPE_JPEG  ) {

$im = @imagecreatefromjpeg($image);

if ($im) {    header ("Content-type: image/jpg");

imagejpeg($im, NULL, 100);

imagedestroy($im);   

}

}

 

How do I read my image into the variable $image?

 

Steve

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.