The classPhpPsdReader.php Class
The classPhpPsdReader.php Class was created by Tim de Koning in 2007. It is based on the GD library, which can do numerous operations on images with PHP, but sadly, can’t open PSD files.
The classPhpPsdReader.php Class can be downloaded for free on PhpClasses.org. It is compatible with both PHP4 and PHP5.
Usage
Nothing hard here. Once you have downloaded the classPhpPsdReader.php class and uploaded it on your server, you’re now ready to display PSD throught a web browser.
To do so, just refer to the following code example:
<?php
// Send header to client browser
header("Content-type: image/jpeg");
// Includes the requested class
include_once('classPhpPsdReader.php');
// Finally display the PSD on the screen
imagejpeg(imagecreatefrompsd('yourPsdFile.psd'));
?>The result

Great tool for people who are, like me, both webdevelopers and webdesigners!
On another note, I just purchased a new blog to complete my network. The blog is called PsdVibe and you can have a look here. The blog focus on providing Adobe Photoshop tutorials, resources and freebies.






My name is Jean-Baptiste Jung and I'm the man behind Cats Who Code. I started to use the Internet back in 1998 and started to create websites three years laters in 2001.
23 Comments
To be honest I didn’t expect this kind of tool to exist, heck I’m going to try it tomorrow to see how it goes.
Didn’t know php was able to do that! Thanks!
PSD files are huge. This might be a nice idea for smaller files but I had projects as big as 10-20 mb. I wouldn’t like to display that on a page and make people load for like 10 minutes.
I don’t know much about web designs… but anyway I enjoyed reading it.
Thanks for the information…
Well, i hear for first time for such a code. It is really interesting, and i am surely that it has some use for web designs or some other purposes.
Anyway, congrats on the psd site purchase. If i am not wrong that is second site about photoshop tutorials that you own ? The first one is psdrecipes..
@Catrin W: Yes, I already have psdrecipes.com, which focus on short/useful Photoshop recipes
That’s a very awesome tool!!
I could never know that it is even possible to embed psd directly in the post. I published a few posts on the topic but I have to use screen capture shots for that. Thanks for sharing an amazing resource.
Oh wow amazing.. where did you discover this trick? lol
Thanks, good stuff!
If you made an artwork with Adobe Photoshop Elements(3.0),can you open the file and/or edit it with other Adobe Photoshops like CS3 and/or CS3..?If not,what are the exceptions?
@Free web page design, I think everything is being installed with installation of Adobe CS3(I am talking about extensions etc) so you would haven’t any problems in doing that.
Superb tutroial, I never thought you could do that with pdf and php together
That’s awesome! As someone who designs webpages and custom graphics, this is something I’ve always needed and never knew it.
I didnt know you could even access or display psd files without using photoshop yet alone via a php page
Brilliant! thanks for the demo. This will really improve my website
I had not known anything about PSD reader!
easy example. Does it work for all browsers?
Thanks a lot. will test it…
Thanks ! Nice to know that this tool is around.
Great post. PHP never fails to amaze!
What is the point of doing this? Why would we want to show PSD files directly?
Sometimes I send my psd sketches to the clients and they don’t have photoshop installed, nice decision in such cases, thanks Jean !
This is not something i would of immediately thought of but i can definately see its uses.
9 Trackbacks
[...] more: PHP: Display Adobe PSD files on a web page Share and [...]
[...] PHP: Display Adobe PSD files on a web page. Share and [...]
[...] PHP: Display Adobe PSD files on a web page "Any webdesigner know the PSD filetype, which is the Adobe Photoshop format. PSDs have a lot of great features, as such as layers, but they can’t being read by a browser. Unless you use this great PHP class!" [...]
[...] <?php // Send header to client browser header(”Content-type: image/jpeg”); // Includes the requested class include_once(’classPhpPsdReader.php’); // Finally display the PSD on the screen imagejpeg(imagecreatefrompsd(’yourPsdFile.psd’)); ?> ÐапиÑал кот, который кодит [...]
[...] PHPã§Photoshopã®PSDファイルを画åƒã«å¤‰æ›ã—ã¦ãƒ–ラウザã«å‡ºåŠ›ã€‚ http://www.catswhocode.com/blog/php-display-adobe-psd- files-on-a-web-page [...]
PHP: Mostrare file photoshop in una pagina web…
Fin’ora eravate abituati con le gif, jpeg o al massimo png, ma se volete potete usare direttamente i vostri capolavori fatti con photoshop nelle vostre pagine web dinamiche, grazie alla magia delle funzioni del php, il linguaggio open source, che oram…
[...] PHP: Display Adobe PSD files on a web page [...]
[...] [本家:http://www.catswhocode.com/blog/php-display-adobe-psd-files-on-a-web-page] [...]
[...] few weeks ago, I wrote an article about this PHP which allow you to display any Adobe PSD file on screen. Very usefull to create [...]