ImageSharp icon indicating copy to clipboard operation
ImageSharp copied to clipboard

Proposal: PSD support

Open vpenades opened this issue 8 years ago • 10 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have verified that I am running the latest version of ImageSharp
  • [X] I have verified if the problem exist in both DEBUG and RELEASE mode
  • [X] I have searched open and closed issues to ensure it has not already been reported

Description

If at some point there's interest in supporting Adobe PSD, in the past I've used this library: http://psdplugin.codeplex.com/

It's a full featured, pure .Net PSD library. It is the current Paint.Dot.Net plugin to load/save PSD, but the core of the library is stand alone and has no dependencies with Paint.Dot.Net

I used it in the past and it's quite complete and safe to use.

vpenades avatar Mar 28 '17 16:03 vpenades

It's covered under MIT license but some bits are borrowed from  http://www.codeproject.com/KB/graphics/PSDParser.aspx and that's under  http://www.opensource.org/licenses/BSD-3-Clause

source: http://psdplugin.codeplex.com/SourceControl/latest#License.txt

so legally it should be ok (according to my 2min google session)

BUT don't get your hopes up @vpenades the amount of things that are on the TODO list is long! and given the fact that a PSD file can have many layers is also going to be a design issue

KLuuKer avatar Mar 28 '17 21:03 KLuuKer

@JimBobSquarePants +1 for psd support! Also would be nice to support DDS files

Krakean avatar Feb 15 '18 20:02 Krakean

Updated link for GitHub repo.

https://github.com/PsdPlugin/PsdPlugin

While this is most certainly something for the future. We should actually have a look at our API now to ensure that we can implement layering in a sane way that works with our existing codecs.

CC/ @tocsoft @antonfirsov @dlemstra

JimBobSquarePants avatar Feb 15 '18 22:02 JimBobSquarePants

I would suggest splitting formats by usage:

  • Main "consumer" formats like GIF, PNG, JPEG, would stay in the main assembly.
  • ImageSharp.EditableFormats for Edition/proffesional formats, like PSD, Krita, etc...
  • ImageSharp.LegacyFormats for PCX, TGA, etc
  • ImageSharp.GPUFormats for hardware accelerated formats like DDS

That would allow adding specialised support for each format group, without clogging the main namespace.

For example, GPU Formats will probably require:

  • CubeMap class to hold 6 images and serializable by the format encoders/decoders.
  • Mipmap/Anisotropic generation support.
  • Probably, some sort of additional processors for handling normal maps and other exotic texture maps.

Professional formats assembly could hold the specialised layering and composition infrastructure.

vpenades avatar Feb 15 '18 23:02 vpenades

I was looking for this tonight for a little tool I'm making to interlace images to produce lenticular prints. In my use case, I'd just want the ability to load a PSD into separate Image<Rgba32> objects for each layer. Blend modes, masks, transparency, etc. would be "nice to have" access to, but really I'm just looking for a stack of individual layers.

richardtallent avatar Nov 28 '19 06:11 richardtallent

Also would be nice to support DDS files

Paint.NET's DDS support is now sourced from @0xC0000054 's DdsFileTypePlus plugin, https://github.com/0xC0000054/pdn-ddsfiletype-plus . This could probably be adapted into something for ImageSharp.

However, it's a Windows-only solution because it uses DirectXTex and DirectCompute. It does encoding of some formats on the GPU (or via WARP).

rickbrew avatar Oct 12 '20 15:10 rickbrew

@rickbrew I might be able to help you here actually. We have a complete (@UkooLabs I'm right it is complete yeah?) DDS format implementation in this side project ImageSharp.Textures.

I've not been able to put any focus on this library at all. Peter has done an absolute ton of work though and I'd like to get things ticking along if I can now we have a stable base library.

JimBobSquarePants avatar Oct 12 '20 22:10 JimBobSquarePants

Oh -- I don't need help, I was just replying to the earlier comment. Thanks though!

rickbrew avatar Oct 12 '20 22:10 rickbrew

@JimBobSquarePants Imagesharp.Textures is waiting me to come back to it, still need to sort more in the Pixel Format area but there are some dds format variants correctly decoding so far.

UkooLabs avatar Oct 12 '20 23:10 UkooLabs

@UkooLabs Let me know what you need!

JimBobSquarePants avatar Oct 13 '20 16:10 JimBobSquarePants