Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

COMPRESSION algo not helpful in PNG cases?

I m trying to compress the PNG images , and have tried to use different COMPRESSION algorithm , but the image file size remains the same. The image I m using is https://upload.wikimedia.org/wikipedia/commons/d/d7/Astro_4D_stars_proper_radial_g_b_8mag_big.png Before resize length 1966656 After resize length IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY - 6355730 After resize length IMWRITE_PNG_STRATEGY_FILTERED - 6355730 After resize length IMWRITE_PNG_STRATEGY_FIXED 6355730 After resize length IMWRITE_PNG_STRATEGY_RLE 6355730 The resizing(decreasing the size) is increasing the size of the image after the first log.

COMPRESSION algo not helpful in PNG cases?

I m trying to compress the PNG images , and have tried to use different COMPRESSION algorithm , but the image file size remains the same. The image I m using is https://upload.wikimedia.org/wikipedia/commons/d/d7/Astro_4D_stars_proper_radial_g_b_8mag_big.png Before resize length 1966656 After resize length IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY - 6355730 After resize length IMWRITE_PNG_STRATEGY_FILTERED - 6355730 After resize length IMWRITE_PNG_STRATEGY_FIXED 6355730 After resize length IMWRITE_PNG_STRATEGY_RLE 6355730 The resizing(decreasing the size) dimension) is increasing the size of the image after the first log.

COMPRESSION algo not helpful in PNG cases?

I m trying to compress the PNG images , and have tried to use different COMPRESSION algorithm , but the image file size remains the same. The image I m using is https://upload.wikimedia.org/wikipedia/commons/d/d7/Astro_4D_stars_proper_radial_g_b_8mag_big.png Before resize length 1966656 After resize length IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY - 6355730 After resize length IMWRITE_PNG_STRATEGY_FILTERED - 6355730 After resize length IMWRITE_PNG_STRATEGY_FIXED 6355730 After resize length IMWRITE_PNG_STRATEGY_RLE 6355730 The resizing(decreasing the dimension) is increasing the size of the image after the first log.

resizeByThird(sourceImage: Path, destinationImage: Path) { val sourceImageMat = imread(sourceImage.toString()) val resizedImage = Mat() resize(sourceImageMat, resizedImage, Size(3840, 2208)) println(sourceImage.toFile().length()) val params: IntArray = intArrayOf(IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY) imwrite(destinationImage.toString(), resizedImage, params) println(destinationImage.toFile().length()) }

COMPRESSION algo not helpful in PNG cases?

I m trying to compress the PNG images , and have tried to use different COMPRESSION algorithm , but the image file size remains the same. The image I m using is https://upload.wikimedia.org/wikipedia/commons/d/d7/Astro_4D_stars_proper_radial_g_b_8mag_big.png Before resize length 1966656 After resize length IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY - 6355730 After resize length IMWRITE_PNG_STRATEGY_FILTERED - 6355730 After resize length IMWRITE_PNG_STRATEGY_FIXED 6355730 After resize length IMWRITE_PNG_STRATEGY_RLE 6355730 The resizing(decreasing the dimension) is increasing the size of the image after the first log.

resizeByThird(sourceImage: Path, destinationImage: Path) { val sourceImageMat = imread(sourceImage.toString()) val resizedImage = Mat() resize(sourceImageMat, resizedImage, Size(3840, 2208)) println(sourceImage.toFile().length()) val params: IntArray = intArrayOf(IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY) imwrite(destinationImage.toString(), resizedImage, params) println(destinationImage.toFile().length()) }

click to hide/show revision 5
None

updated 2020-06-30 03:01:28 -0600

berak gravatar image

COMPRESSION algo not helpful in PNG cases?

I m trying to compress the PNG images , and have tried to use different COMPRESSION algorithm , but the image file size remains the same. The image I m using is https://upload.wikimedia.org/wikipedia/commons/d/d7/Astro_4D_stars_proper_radial_g_b_8mag_big.png Before resize length 1966656 After resize length IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY - 6355730 After resize length IMWRITE_PNG_STRATEGY_FILTERED - 6355730 After resize length IMWRITE_PNG_STRATEGY_FIXED 6355730 After resize length IMWRITE_PNG_STRATEGY_RLE 6355730 The resizing(decreasing the dimension) is increasing the size of the image after the first log.

resizeByThird(sourceImage: Path, destinationImage: Path) {
val sourceImageMat = imread(sourceImage.toString())
val resizedImage = Mat()
resize(sourceImageMat, resizedImage, Size(3840, 2208))
println(sourceImage.toFile().length())
val params: IntArray = intArrayOf(IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY)
imwrite(destinationImage.toString(), resizedImage, params)
println(destinationImage.toFile().length())
}

}

COMPRESSION algo not helpful in PNG cases?

I m trying to compress the PNG images , and have tried to use different COMPRESSION algorithm , but the image file size remains the same. The image I m using is https://upload.wikimedia.org/wikipedia/commons/d/d7/Astro_4D_stars_proper_radial_g_b_8mag_big.png https://upload.wikimedia.org/wikipedia/commons/d/d7/Astro_4D_stars_proper_radial_g_b_8mag_big.png

  • Before resize length 1966656 After resize length 1966656
  • After resize length IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY - 6355730 After resize length - 6355730
  • After resize length IMWRITE_PNG_STRATEGY_FILTERED - 6355730 After resize length - 6355730
  • After resize length IMWRITE_PNG_STRATEGY_FIXED 6355730 After resize length 6355730
  • After resize length IMWRITE_PNG_STRATEGY_RLE 6355730 6355730

The resizing(decreasing the dimension) is increasing the size of the image after the first log.

resizeByThird(sourceImage: Path, destinationImage: Path) {
        val sourceImageMat = imread(sourceImage.toString())
        val resizedImage = Mat()
        resize(sourceImageMat, resizedImage, Size(3840, 2208))
        println(sourceImage.toFile().length())
        val params: IntArray = intArrayOf(IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY)
        imwrite(destinationImage.toString(), resizedImage, params)
        println(destinationImage.toFile().length())
    }