Product Family

ایڈوب فوٹوشاپ فائل فارمیٹ حل

ہائی کوڈ APIs اور پی ایس ڈی کے لئے مفت اطلاقات, فائلوں کے سائز کو کم کرنے اور undocumented امکانات کا استعمال کرتے ہوئے سکیڑیں کرنے کی صلاحیت کے ساتھ پی ایس بی

پی ایس ڈی سکیڑیں اور اس کے سائز کو کم کرنے کے لئے مفت آن لائن اپلی کیشن

نقصان دہ اور نقصان دہ طریقوں کا استعمال کرتے ہوئے بڑے پی ایس ڈی اور پی ایس بی فائلوں کو سکیڑیں. Aspose.PSD کی پوشیدہ صلاحیت دریافت کریں. یہ ہمیشہ پی ایس ڈی فائل میں ڈیٹا کے لئے محفوظ نہیں ہے، لہذا اگر آپ اکثر استعمال کرتے ہیں تو آپ کو کمپریشن کے بعد پی ایس ڈی فائلوں کی جانچ کرنا چاہئے. براہ کرم نوٹ کریں, کہ کچھ سکیڑیں خصوصیات Lossy ہیں, لہذا کمپریشن کی ان اقسام کے بعد آپ کو ابتدائی پی ایس ڈی فائلوں کو بحال کرنے کے قابل نہیں ہو گا. یہ خصوصیت “جیسا ہے” فراہم کی جاتی ہے. آپ پی ایس ڈی سکیڑیں یا پی ایس بی فائلوں کے سائز کو کم کر سکتے ہیں.

Drag and drop a file or select add Image

your image

Lossless PSD Compress methods

Lossy PSD Compress methods

Compress PSD

You can reproduce the main functionality of this built-in app using Aspose.PSD for .NET

      // Lossless compression
        // Remove Cache Data			
        Stream RemoveCacheData(PsdImage image)
        {
            foreach (var layer in image.Layers)
            {
                // Can be applied
                if (layer is TextLayer || layer is FillLayer)
                {
                    layer.SaveArgb32Pixels(layer.Bounds, new int[layer.Bounds.Width * layer.Bounds.Height]);
                }
            }

            var stream = new MemoryStream();
            image.Save(stream, new PsdOptions(image));

            return stream;
        }

        // Applying RLE Compression
        Stream ApplyRleCompression(PsdImage image)
        {
            foreach (var layer in image.Layers)
            {

                foreach (var channelInformation in layer.ChannelInformation)
                {
                    // Can be applied
                    if (channelInformation.CompressionMethod == CompressionMethod.Raw)
                    {
                        var stream = new MemoryStream();
                        image.Save(stream, new PsdOptions(image)
                        {
                            CompressionMethod = CompressionMethod.RLE
                        });

                        return stream;
                    }
                }
            }

            // Can not be applied
            return null;
        }

        // Lossy methods.
        // 8 Bit Conversion
        Stream ApplyConversionTo8Bit(PsdImage image)
        {
            if (image.BitsPerChannel > 8)
            {
                var stream = new MemoryStream();
                image.Save(stream, new PsdOptions(image)
                {
                    ChannelBitsCount = 8
                });

                stream.Position = 0;

                return stream;
            }

            return null;
        }
       
        // RGBA Conversion
        Stream ApplyConversionToRGBA(PsdImage image)
        {
            if (image.ColorMode == ColorModes.Cmyk)
            {
                var stream = new MemoryStream();
                image.Save(stream, new PsdOptions(image)
                {
                    ColorMode = ColorModes.Rgb
                });

                stream.Position = 0;

                return stream;
            }

            return null;
        }

        // Layers merging
        Stream ApplyMergingLayers(PsdImage image)
        {
            if (image.Layers.Length > 1)
            {
                image.FlattenImage();
                var stream = new MemoryStream();
                image.Save(stream, new PsdOptions(image));

                stream.Position = 0;

                return stream;
            }

            return null;
        }

        // Remove Not Visible Layers
        Stream RemoveNotVisibleLayers(PsdImage image)
        {
            var layersSet = new List<Layer>();
            foreach (var layer in image.Layers)
            {
                // Can be applied
                if ((!layer.IsVisible || !layer.IsVisibleInGroup) && !(layer is LayerGroup))
                {
                    layersSet.Add(layer);
                }
            }

            image.Layers = layersSet.ToArray();
            var stream = new MemoryStream();
            image.Save(stream, new PsdOptions(image));

            return stream;
        }

You can download Aspose.PSD for .NET from Nuget package manager

You can reproduce the main functionality of this built-in app using Aspose.PSD for Java

public class CompressionUtils {

    public static OutputStream removeCacheData(PsdImage image) {
        for (Layer layer : image.getLayers()) {
            if (layer instanceof TextLayer || layer instanceof FillLayer) {
                layer.saveArgb32Pixels(layer.getBounds(), new int[layer.getBounds().getWidth() * layer.getBounds().getHeight()]);
            }
        }

        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        image.save(stream, new PsdOptions(image));

        return stream;
    }

    public static OutputStream applyRleCompression(PsdImage image) {
        for (Layer layer : image.getLayers()) {
            for (var channelInformation : layer.getChannelInformation()) {
                if (channelInformation.getCompressionMethod() == CompressionMethod.Raw) {
                    ByteArrayOutputStream stream = new ByteArrayOutputStream();
                    image.save(stream, new PsdOptions(image) {{
                        setCompressionMethod(CompressionMethod.RLE);
                    }});

                    return stream;
                }
            }
        }

        return null;
    }

    public static OutputStream applyConversionTo8Bit(PsdImage image) {
        if (image.getBitsPerChannel() > 8) {
            ByteArrayOutputStream stream = new ByteArrayOutputStream();
            image.save(stream, new PsdOptions(image) {{
                setChannelBitsCount(8);
            }});

            stream.Position = 0;

            return stream;
        }

        return null;
    }

    public static OutputStream applyConversionToRGBA(PsdImage image) {
        if (image.getColorMode() == ColorModes.Cmyk) {
            ByteArrayOutputStream stream = new ByteArrayOutputStream();
            image.save(stream, new PsdOptions(image) {{
                setColorMode(ColorModes.Rgb);
            }});

            stream.Position = 0;

            return stream;
        }

        return null;
    }

    public static OutputStream applyMergingLayers(PsdImage image) {
        if (image.getLayers().length > 1) {
            image.flattenImage();
            ByteArrayOutputStream stream = new ByteArrayOutputStream();
            image.save(stream, new PsdOptions(image));

            stream.Position = 0;

            return stream;
        }

        return null;
    }

    public static OutputStream removeNotVisibleLayers(PsdImage image) {
        List layersSet = new ArrayList<>();
        for (Layer layer : image.getLayers()) {
            if ((!layer.isVisible() || !layer.isVisibleInGroup()) && !(layer instanceof LayerGroup)) {
                layersSet.add(layer);
            }
        }

        image.setLayers(layersSet.toArray(new Layer[0]));
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        image.save(stream, new PsdOptions(image));

        return stream;
    }
}

You can download Aspose.PSD for Java from Aspose Repository

This App is completely free, but it just a small piece of functionality that offers for you Aspose.PSD library. You can make your own app with any functionality of Aspose.PSD. If you can not find needed feature in Aspose.PSD, you can post on PSD Support Forum. The great support, different priceing plans, prioritized bug fixes and feature releasing for the Paid Support Customers.

List of Aspose.PSD versions for different configurations

Aspose.PSD for .NET

Aspose.PSD for Java


Aspose.PSD for .NET has the version for the most popular .NET versions including: .NET Framework 2, 3.5, 4.0, 4.0CP, .netstandard 2, .NET 5, 6, 7. Version of .NET Library for .NET 7 is suitable for the mobile development
Aspose.PSD for Java made on the Java 1.6, so it can be used in the any popular Java configurations. It's suitable for Cross-platform developement
Official Aspose.PSD for .NET pageOfficial Aspose.PSD for Java page
Aspose.PSD for .NET Pricing plansAspose.PSD for Java Pricing plans

Please check the support forum. Where you can feel the real customer care

Aspose.PSD سکیڑیں خصوصیات ہائی کوڈ API کا استعمال کرتے ہیں. کمپریس پی ایس ڈی حل جاوا اور. NET میں دستیاب ہے. آپ اپنی ویب سروس کے بیک آخر پر کمپریشن یا دیگر کاموں کے لئے Aspose.PSD استعمال کرسکتے ہیں.