Jump to content
How to Install Plugins ×

Photoshop PSD file plugin (newest version: 2.5.0)


taoyue

Recommended Posts

Hello and thanks for creating this plugin. It has saved me from a bunch of trouble by allowing me to view/edit my various PSD source images on machines that do not have Photoshop installed on it.

If I can make a suggestion, please include readme files in your archives. They are very important since they will become detached from their source location (such as this thread).

Including a readme can provide very helpful information as well as keeping credits with the file and your permissions/licensing info too.

Here is a readme file I put together and have with my local copy. Feel free to use.

Name: PhotoShop Plugin
Version: 1.6.0
Date: 12/28/2010
Category: Plugin
Cost: Free (Open Source)
Requirements: Paint.NET 2.6+
Author: Originally written by Frank Blumenberg in 2006, maintained by Tao Yue since 2010
Source: http://frankblumenberg.de/doku/doku.php?id=paintnet:psdplugin
Download: http://psdplugin.codeplex.com/

Description
-----------
This plugin allows you to open and save Adobe Photoshop files (.PSD)

Installation
------------
Copy the PhotoShop.dll to the “FileTypes” sub-folder in the Paint.NET installation directory.

Example:

C:\Program Files\Paint.NET\FileTypes\PhotoShop.dll

The next time you start Paint.NET, you will see a new option in the Open and Save dialog boxes: "Photoshop (*.psd)"

Features
--------
* Loading and Saving
  - Layers
  - RLE-compression
  - 32 bit-RGBA colorspace 

* Load-only
  - Photoshop .PSD files with the following colorspaces are converted to RGBA on load:
    -> Bitmap
    -> Grayscale
    -> Duotone (color information discarded, treated as grayscale)
    -> Indexed
    -> CMYK
    -> Multichannel CMY
    -> Lab 
  - Masks are applied to the layer on load. Vector masks are ignored.

A permission section can clarify your wishes regarding what license you want this under or just to clarify if you mind others making changes or hosting the file at other sites, etc.

Thanks,

LHammonds

FYI - I'm not using signature for "signature" links since it can get you banned on this site.

Link to comment
Share on other sites

  • 2 weeks later...

Layer names containing german umlauts are corrupted when I save to .psd and load the .psd again.

I checked the source and figured out that the plugin just reads and writes the names in pascal format.

I checked the psd specification and it tells that a unicode layer name can be stored in the "Additional Layer Information" area.

Would be nice if this could be implemented.

Unicode layer name (Photoshop 5.0)

Key is 'luni' . Data is as follows:

Unicode Layer name

Length

Description

Variable

Unicode string (4 bytes length + string).

midoras signature.gif

Link to comment
Share on other sites

Thanks for the bug report and the investigation.

I've just committed changeset 1c3b7fb44cc0, adding proper handling of Unicode layer names.

Link to comment
Share on other sites

Thanks for the bug report and the investigation.

I've just committed changeset 1c3b7fb44cc0, adding proper handling of Unicode layer names.

Works for me now, thanks from Switzerland.

You forced me to install MS Visual C# Express to compile the changeset.

But because I like to do a pdf plugin next, this was an open issue on my list. ;-)

Let's see how much time it takes to get into this c# stuff.

midoras signature.gif

Link to comment
Share on other sites

Thanks for the bug report and the investigation.

I've just committed changeset 1c3b7fb44cc0, adding proper handling of Unicode layer names.

There seems to be a small issue. I saved a file with two layers and analyzed the result (just to see what you are doing ;-)

Hidden Content:

As you can see from the screenshot there are two 'luni' blocks per layer record.

So each layers gets the correct unicode name but twice.

Edited by pyrochild

midoras signature.gif

Link to comment
Share on other sites

Resolution issues

From my knowledge

this.m_hRes = reader.ReadInt16();

this.m_hResUnit = (ResUnit)reader.ReadInt32();

must be

this.m_hRes = reader.ReadInt32();

this.m_hResUnit = (ResUnit)reader.ReadInt16();

Also the writer

OnLoad: hResUnit is ignored and the plugin expects that hRes and vRes contain dpi values.

OnSave: if input.DpuUnit is not inch then the code is incomplete and may be wrong.

midoras signature.gif

Link to comment
Share on other sites

Why are you posting raw PNG data as text?

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

Why are you posting raw PNG data as text?

I pasted the image from the Windows clipboard into the forum editor and it looked as expected. Pressing "Add Reply" changed it to this text representation. I tried to change this by editing the post. But entering the forum editor the image was ok again. So I thougth to ask in the support forum what is going wrong. Any hint?

midoras signature.gif

Link to comment
Share on other sites

midori: the best way to include images on this forum is to attach them. (Use the full editor -- the quick reply editor doesn't have the Attach function.) This allows the images to be viewed immediately in a web browser, without having to copy-paste to a temporary file and then decode.

I took a look at your screenshot. In my testing, I have not seen duplicate "luni" resources in a hex editor. If you have a .PDN file that can reliably reproduce the problem when saved out to a .PSD, then I can investigate further.

I filed bug 7963 in Codeplex to track the ResolutionInfo problems. Since you're a programmer, you might consider filing bugs directly in Codeplex in the future.

Link to comment
Share on other sites

midori: the best way to include images on this forum is to attach them. (Use the full editor -- the quick reply editor doesn't have the Attach function.) This allows the images to be viewed immediately in a web browser, without having to copy-paste to a temporary file and then decode.

Strange that the forum editor allows to paste and show a screenshot but then later does not show it in the post. Saving and attaching is a little bit more work.

I took a look at your screenshot. In my testing, I have not seen duplicate "luni" resources in a hex editor. If you have a .PDN file that can reliably reproduce the problem when saved out to a .PSD, then I can investigate further.

It is easy to reproduce here (pdn 3.5.8). Create a new image in pdn add a second layer and save it as .psd. Just with a simple hex editor I see four lunis instead of two.

midoras signature.gif

Link to comment
Share on other sites

Duplicate Unicode layer names: fixed in changeset b4e2cc01eebc.

Checked. No duplicates anymore. Thanks.

midoras signature.gif

Link to comment
Share on other sites

Strange that the forum editor allows to paste and show a screenshot but then later does not show it in the post.

I think that's just your browser, mate. I can't do it.

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

I think that's just your browser, mate. I can't do it.

I'm using Firefox 5.0.

Anyway I will avoid this in the future as long as the pasted image is visible in the forum editor but not in "Preview Post".

midoras signature.gif

Link to comment
Share on other sites

  • 2 weeks later...

Announcing the release of version 2.0 of the PSD plugin for Paint.NET. Now posted on Codeplex: http://psdplugin.codeplex.com/

Please note that this is a .0 release that includes substantial refactoring of the underlying code. Substantial regression testing has been performed, but there may still be bugs. As always, please report any problems on the forum or via Codeplex.

Major new features:

  • Higher color-depth images can be loaded. Since Paint.NET represents images using 32-bit color (8 bits/channel):
    • 16 bits/channel images will lose some precision.
    • 32 bits/channel images will be truncated to the standard dynamic range.

    [*]ZIP-compressed images can now be loaded.

    • Newer versions of Photoshop use this type of compression for 16 bits/channel and 32 bits/channel images.
    • Older versions of Photoshop also offered this as an option for 8 bits/channel images.

Bugfixes and other minor changes:

  • Empty layers are now preserved on load and save.
  • Layer names can now contain Unicode characters.
  • Several mismapped layer blend modes are now mapped correctly between Paint.NET and PSD: Color burn, Color dodge, and Additive.
  • Somewhat faster saving of images when a large portion of a layer is non-transparent.
  • PSD files created by Adobe Photodeluxe are no longer blocked from loading.
  • The plugin will now verify that sufficient memory exists to load a .PSD file into Paint.NET. The user will get an out-of-memory error, rather than experience an apparent hang as the disk thrashes from virtual memory paging.

Bugs reports and suggestions from the following users were incorporated in this release: Aleksandr Zamerov, LHammonds, midora, rsiskd, Serissa. Thank you for helping to make the plugin better for everyone!

Link to comment
Share on other sites

  • 3 months later...
  • 3 weeks later...
  • 2 months later...

Yeah this file is coming out completely corrupt. I have a mac running a windows VM :-) when I open the .psd in 'preview' on the Mac I can see my two tabs, but when I open it using Paint.net it is screwed up. I can see the layers but all the bits of the image just look like static.

Preview on mac:

tabsScreenShot.png

Paint.net:

paint.png

The PSD source file is 25 meg.

Any ideas?

Link to comment
Share on other sites

Might be CMYK conversion issue. I've seen that (in my limited use) of it coming out like that with CMYK source PSD files. If it can be converted to RGB at the source, you *may* get a different result when imorting it into PDN.

***

Gallery at PDN-Fans

Link to comment
Share on other sites

Yeah this file is coming out completely corrupt. I have a mac running a windows VM :-) when I open the .psd in 'preview' on the Mac I can see my two tabs, but when I open it using Paint.net it is screwed up. I can see the layers but all the bits of the image just look like static.

If you could point me to the original PSD file (or upload it somewhere), then I'll certainly take a look at what's going on. Could be a colorspace issue like delpart suggested, but could be caused by a lot of other things, too.

Might be CMYK conversion issue. I've seen that (in my limited use) of it coming out like that with CMYK source PSD files. If it can be converted to RGB at the source, you *may* get a different result when imorting it into PDN.

I'd be interested in debugging with these files, too. CMYK files will not be color-accurate when loaded in, because the conversion completely ignores the color profile. But it should not load in as static. If it does, then that's a bug in the plugin.

Edited by taoyue
Link to comment
Share on other sites

'Tis a filetype plugin: ie. expands the types of files that Paint.NET can load and save.

In this case Photoshop's PSD filetype can be opened and saved with Paint.NET (after installation by dropping the dll into the filetypes folder).

How does it work - exceedingly well! :lol:

More seriously, Paint.NET cannot replicate everything that PS stuffs into its files & layers, so there are some PS features that may not translate perfectly.

Link to comment
Share on other sites

  • 1 month later...

Version 2.1 of the Paint.NET PSD Plugin has been released: http://psdplugin.codeplex.com/

Changes:

  • Fixed a bug in which layer blend modes were not saved when the Paint.NET language is not set to English. Layer blend modes are now preserved on non-English languages as well.
  • Malformed PSD files with missing channels can now be loaded in.
  • Preserves image resolution, so that physical dimensions will be correct along with pixel dimensions.
  • Sets the VersionInfo resource on PSD files to indicate the PSDPlugin version used when saving the file.
  • Fixed a race condition in the parallelized loading, causing random load failures on files with lots of tiny layers.

Edited by taoyue
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...