Why there is no image compression for GIF, JPEG, PNG image
-
- Posts: 10
- Joined: Wed May 15, 2019 10:04 am
Why there is no image compression for GIF, JPEG, PNG image
Hi There,
As per subject, there is only image compression for TIFF image type, code as below:
Dim tiffCompression As GdPicture14.TiffCompression = _gdPictureImaging.GetTiffCompression(_currentImage)
and this will return all the available tiffCompression as below:
TiffCompressionUnknown = 0
TiffCompressionNONE = 1
TiffCompressionRLE = 2
TiffCompressionCCITT3 = 3
TiffCompressionCCITT4 = 4
TiffCompressionLZW = 5
TiffCompressionOJPEG = 6
TiffCompressionJPEG = 7
TiffCompressionADOBEDEFLATE = 8
TiffCompressionNEXT = 32766
TiffCompressionCCITTRLEW = 32771
TiffCompressionPACKBITS = 32773
TiffCompressionTHUNDERSCAN = 32809
TiffCompressionDEFLATE = 32946
TiffCompressionAUTO = 65536
But there is no other compression for image type like GIF, JPEG, PNG.
Please help on this. Thanks.
Best Regards,
Jun Wei
As per subject, there is only image compression for TIFF image type, code as below:
Dim tiffCompression As GdPicture14.TiffCompression = _gdPictureImaging.GetTiffCompression(_currentImage)
and this will return all the available tiffCompression as below:
TiffCompressionUnknown = 0
TiffCompressionNONE = 1
TiffCompressionRLE = 2
TiffCompressionCCITT3 = 3
TiffCompressionCCITT4 = 4
TiffCompressionLZW = 5
TiffCompressionOJPEG = 6
TiffCompressionJPEG = 7
TiffCompressionADOBEDEFLATE = 8
TiffCompressionNEXT = 32766
TiffCompressionCCITTRLEW = 32771
TiffCompressionPACKBITS = 32773
TiffCompressionTHUNDERSCAN = 32809
TiffCompressionDEFLATE = 32946
TiffCompressionAUTO = 65536
But there is no other compression for image type like GIF, JPEG, PNG.
Please help on this. Thanks.
Best Regards,
Jun Wei
-
- Posts: 10
- Joined: Wed May 15, 2019 10:04 am
Re: Why there is no image compression for GIF, JPEG, PNG image
Help on this please ?
Best Regards,
Jun Wei
Best Regards,
Jun Wei
Re: Why there is no image compression for GIF, JPEG, PNG image
Hello,
Please find the requested methods here:
for JPG (see Quality, Progressive parametets)
SaveAsJPEG
for PNG (see CompressionLevel parameter)
SaveAsPNG
Please refer to the parameters and set them according what you need.
Please find the requested methods here:
for JPG (see Quality, Progressive parametets)
SaveAsJPEG
for PNG (see CompressionLevel parameter)
SaveAsPNG
Please refer to the parameters and set them according what you need.
-
- Posts: 10
- Joined: Wed May 15, 2019 10:04 am
Re: Why there is no image compression for GIF, JPEG, PNG image
Hi Gabriela,
This is not what I want.
I would like to have something like the code below:
Dim gifCompression As GdPicture14.GifDisposalMethod= _gdPictureImaging.GetGifCompression(_currentImage)
And it will return something like:
Public Enum GifDisposalMethod
GifDisposalMethodNotSet = -1
NoDisposalMethod = 0
DoNotDispose = 1
RestoreBackgroundColor = 2
RestoreToPrevious = 3
End Enum
Dim jpgCompression As GdPicture14.JpgDctMethod= _gdPictureImaging.GetJPGCompression(_currentImage)
And it will return me something like :
Public Enum JpgDctMethod
Dct_Not_Set = 0
Dct_ISlow = 1
Dct_IFast = 2
Dct_Float = 3
End Enum
Best Regards,
Jun Wei
This is not what I want.
I would like to have something like the code below:
Dim gifCompression As GdPicture14.GifDisposalMethod= _gdPictureImaging.GetGifCompression(_currentImage)
And it will return something like:
Public Enum GifDisposalMethod
GifDisposalMethodNotSet = -1
NoDisposalMethod = 0
DoNotDispose = 1
RestoreBackgroundColor = 2
RestoreToPrevious = 3
End Enum
Dim jpgCompression As GdPicture14.JpgDctMethod= _gdPictureImaging.GetJPGCompression(_currentImage)
And it will return me something like :
Public Enum JpgDctMethod
Dct_Not_Set = 0
Dct_ISlow = 1
Dct_IFast = 2
Dct_Float = 3
End Enum
Best Regards,
Jun Wei
Re: Why there is no image compression for GIF, JPEG, PNG image
Hi,
The JPG, PNG, GIF formats are others than TIFF. The toolkit opens jpg/png/gif formatted files into a bitmap. Once they are opened, there is no information about the used compression available. And actually, it is not needed, as you should next save the images always defining the required compression. May I ask to explain in details your use-case why you need to know the used compression so maybe we can help you further? Thank you.
The JPG, PNG, GIF formats are others than TIFF. The toolkit opens jpg/png/gif formatted files into a bitmap. Once they are opened, there is no information about the used compression available. And actually, it is not needed, as you should next save the images always defining the required compression. May I ask to explain in details your use-case why you need to know the used compression so maybe we can help you further? Thank you.
-
- Posts: 10
- Joined: Wed May 15, 2019 10:04 am
Re: Why there is no image compression for GIF, JPEG, PNG image
Hi Gabriela,
This is the behavior of our application.
We will show the compression method when users click on picture.
Is it really no way to show this ?
Best Regards,
Jun Wei
This is the behavior of our application.
We will show the compression method when users click on picture.
Is it really no way to show this ?
Best Regards,
Jun Wei
-
- Posts: 10
- Joined: Wed May 15, 2019 10:04 am
Re: Why there is no image compression for GIF, JPEG, PNG image
Hi Gabriela,
Any update about this issue ?
Best Regards,
Jun Wei
Any update about this issue ?
Best Regards,
Jun Wei
Re: Why there is no image compression for GIF, JPEG, PNG image
Hello,
Here are some useful links:
https://superuser.com/questions/919580/ ... t-is-lossy
https://photo.stackexchange.com/questio ... cular-jpeg
Maybe there is a confusion between compression schemes and options used by the compression schemes:
JPEG uses always dctdecode, PNG always uses deflate, GIF LZW.
Almost each compression schemes are using different options. Some of them can be retrieved by exif metadata.
Here are some useful links:
https://superuser.com/questions/919580/ ... t-is-lossy
https://photo.stackexchange.com/questio ... cular-jpeg
Maybe there is a confusion between compression schemes and options used by the compression schemes:
JPEG uses always dctdecode, PNG always uses deflate, GIF LZW.
Almost each compression schemes are using different options. Some of them can be retrieved by exif metadata.
-
- Posts: 2
- Joined: Fri Jun 16, 2023 3:03 pm
Re: Why there is no image compression for GIF, JPEG, PNG image
When it comes to GIF compression, reducing the number of colors and frames, as well as employing techniques like LZW compression, can significantly decrease file sizes.
Who is online
Users browsing this forum: No registered users and 1 guest