Как заставить pngcrush перезаписывать исходные файлы?

Забыл обновить решение.

Я установил JDK 1.7, создал настройку eclipse для работы с 1.7, и теперь волшебный 1.6 тоже работает. Может быть, я должен был попробовать, что сделал Рик. Я буду в следующий раз.

14
задан 12 June 2012 в 23:43

18 ответов

Все в одной строке:

for file in *.png; do pngcrush "$file" "${file%.png}-crushed.png" && mv ${file%.png}-crushed.png" "$file"; done

должен это сделать.

(Хотя до сих пор в моих собственных тестах менее половины png, которые я тестировал pngcrush, были меньше потом, так что цвет меня не впечатлил.)

16
ответ дан 25 July 2018 в 22:28

Все в одной строке:

for file in *.png; do pngcrush "$file" "${file%.png}-crushed.png" && mv ${file%.png}-crushed.png" "$file"; done

должен это сделать.

(Хотя до сих пор в моих собственных тестах менее половины png, которые я тестировал pngcrush, были меньше потом, так что цвет меня не впечатлил.)

16
ответ дан 26 July 2018 в 21:51

Все в одной строке:

for file in *.png; do pngcrush "$file" "${file%.png}-crushed.png" && mv ${file%.png}-crushed.png" "$file"; done

должен это сделать.

(Хотя до сих пор в моих собственных тестах менее половины png, которые я тестировал pngcrush, были меньше потом, так что цвет меня не впечатлил.)

16
ответ дан 31 July 2018 в 10:41

Все в одной строке:

for file in *.png; do pngcrush "$file" "${file%.png}-crushed.png" && mv ${file%.png}-crushed.png" "$file"; done

должен это сделать.

(Хотя до сих пор в моих собственных тестах менее половины png, которые я тестировал pngcrush, были меньше потом, так что цвет меня не впечатлил.)

16
ответ дан 31 July 2018 в 11:45

Все в одной строке:

for file in *.png; do pngcrush "$file" "${file%.png}-crushed.png" && mv ${file%.png}-crushed.png" "$file"; done

должен это сделать.

(Хотя до сих пор в моих собственных тестах менее половины png, которые я тестировал pngcrush, были меньше потом, так что цвет меня не впечатлил.)

16
ответ дан 2 August 2018 в 03:55

Все в одной строке:

for file in *.png; do pngcrush "$file" "${file%.png}-crushed.png" && mv ${file%.png}-crushed.png" "$file"; done

должен это сделать.

(Хотя до сих пор в моих собственных тестах менее половины png, которые я тестировал pngcrush, были меньше потом, так что цвет меня не впечатлил.)

16
ответ дан 4 August 2018 в 19:58

Все в одной строке:

for file in *.png; do pngcrush "$file" "${file%.png}-crushed.png" && mv ${file%.png}-crushed.png" "$file"; done

должен это сделать.

(Хотя до сих пор в моих собственных тестах менее половины png, которые я тестировал pngcrush, были меньше потом, так что цвет меня не впечатлил.)

16
ответ дан 6 August 2018 в 04:00

Все в одной строке:

for file in *.png; do pngcrush "$file" "${file%.png}-crushed.png" && mv ${file%.png}-crushed.png" "$file"; done

должен это сделать.

(Хотя до сих пор в моих собственных тестах менее половины png, которые я тестировал pngcrush, были меньше потом, так что цвет меня не впечатлил.)

16
ответ дан 7 August 2018 в 21:59

Все в одной строке:

for file in *.png; do pngcrush "$file" "${file%.png}-crushed.png" && mv ${file%.png}-crushed.png" "$file"; done

должен это сделать.

(Хотя до сих пор в моих собственных тестах менее половины png, которые я тестировал pngcrush, были меньше потом, так что цвет меня не впечатлил.)

16
ответ дан 10 August 2018 в 10:13

Все в одной строке:

for file in *.png; do pngcrush "$file" "${file%.png}-crushed.png" && mv ${file%.png}-crushed.png" "$file"; done

должен это сделать.

(Хотя до сих пор в моих собственных тестах менее половины png, которые я тестировал pngcrush, были меньше потом, так что цвет меня не впечатлил.)

16
ответ дан 13 August 2018 в 16:35
  • 1
    Спасибо! Сумма, которую вы можете сжать PNG, может зависеть от того, как они были сделаны. Я считаю, что Photoshop «Сохранить для Интернета» имеет встроенную дробилку PNG. – DisgruntledGoat 17 February 2011 в 14:40
  • 2
    Большинство моих были созданы с помощью команды импорта ImageMagick. Я избегаю коммерческого программного обеспечения, такого как Photoshop, когда это возможно. – frabjous 17 February 2011 в 21:45
  • 3
    используйте -brute для лучшего сжатия. – Collin Anderson 7 August 2012 в 08:00
  • 4
    Другой ответ теперь лучше с новым pngcrush. – Hugo 19 October 2015 в 10:58

Начиная с версии 1.7.22, pngcrush имеет параметр перезаписи.

Попробуйте

pngcrush -ow file.png

См. «Список изменений» для получения дополнительной информации:

Version 1.7.22  (built with libpng-1.5.6 and zlib-1.2.5)
  Added "-ow" (overwrite) option.  The input file is overwritten and the
    output file is just used temporarily and removed after it is copied
    over the input file..  If you do not specify an output file, "pngout.png"
    is used as the temporary file. Caution: the temporary file must be on
    the same filesystem as the input file.  Contributed by a group of students
    of the University of Paris who were taking the "Understanding of Programs"
    course and wished to gain familiarity with an open-source program.
19
ответ дан 25 May 2018 в 22:58

Начиная с версии 1.7.22, pngcrush имеет параметр перезаписи.

Попробуйте

pngcrush -ow file.png

См. Changelog для получения дополнительной информации :

Version 1.7.22  (built with libpng-1.5.6 and zlib-1.2.5)
  Added "-ow" (overwrite) option.  The input file is overwritten and the
    output file is just used temporarily and removed after it is copied
    over the input file..  If you do not specify an output file, "pngout.png"
    is used as the temporary file. Caution: the temporary file must be on
    the same filesystem as the input file.  Contributed by a group of students
    of the University of Paris who were taking the "Understanding of Programs"
    course and wished to gain familiarity with an open-source program.
20
ответ дан 25 July 2018 в 22:28

Начиная с версии 1.7.22, pngcrush имеет параметр перезаписи.

Попробуйте

pngcrush -ow file.png

См. Changelog для получения дополнительной информации :

Version 1.7.22  (built with libpng-1.5.6 and zlib-1.2.5)
  Added "-ow" (overwrite) option.  The input file is overwritten and the
    output file is just used temporarily and removed after it is copied
    over the input file..  If you do not specify an output file, "pngout.png"
    is used as the temporary file. Caution: the temporary file must be on
    the same filesystem as the input file.  Contributed by a group of students
    of the University of Paris who were taking the "Understanding of Programs"
    course and wished to gain familiarity with an open-source program.
20
ответ дан 26 July 2018 в 21:51

Начиная с версии 1.7.22, pngcrush имеет параметр перезаписи.

Попробуйте

pngcrush -ow file.png

См. Changelog для получения дополнительной информации :

Version 1.7.22  (built with libpng-1.5.6 and zlib-1.2.5)
  Added "-ow" (overwrite) option.  The input file is overwritten and the
    output file is just used temporarily and removed after it is copied
    over the input file..  If you do not specify an output file, "pngout.png"
    is used as the temporary file. Caution: the temporary file must be on
    the same filesystem as the input file.  Contributed by a group of students
    of the University of Paris who were taking the "Understanding of Programs"
    course and wished to gain familiarity with an open-source program.
20
ответ дан 31 July 2018 в 10:41

Начиная с версии 1.7.22, pngcrush имеет параметр перезаписи.

Попробуйте

pngcrush -ow file.png

См. Changelog для получения дополнительной информации :

Version 1.7.22  (built with libpng-1.5.6 and zlib-1.2.5)
  Added "-ow" (overwrite) option.  The input file is overwritten and the
    output file is just used temporarily and removed after it is copied
    over the input file..  If you do not specify an output file, "pngout.png"
    is used as the temporary file. Caution: the temporary file must be on
    the same filesystem as the input file.  Contributed by a group of students
    of the University of Paris who were taking the "Understanding of Programs"
    course and wished to gain familiarity with an open-source program.
20
ответ дан 31 July 2018 в 11:45

Начиная с версии 1.7.22, pngcrush имеет параметр перезаписи.

Попробуйте

pngcrush -ow file.png

См. Changelog для получения дополнительной информации :

Version 1.7.22  (built with libpng-1.5.6 and zlib-1.2.5)
  Added "-ow" (overwrite) option.  The input file is overwritten and the
    output file is just used temporarily and removed after it is copied
    over the input file..  If you do not specify an output file, "pngout.png"
    is used as the temporary file. Caution: the temporary file must be on
    the same filesystem as the input file.  Contributed by a group of students
    of the University of Paris who were taking the "Understanding of Programs"
    course and wished to gain familiarity with an open-source program.
20
ответ дан 2 August 2018 в 03:55

Начиная с версии 1.7.22, pngcrush имеет параметр перезаписи.

Попробуйте

pngcrush -ow file.png

См. Changelog для получения дополнительной информации :

Version 1.7.22  (built with libpng-1.5.6 and zlib-1.2.5)
  Added "-ow" (overwrite) option.  The input file is overwritten and the
    output file is just used temporarily and removed after it is copied
    over the input file..  If you do not specify an output file, "pngout.png"
    is used as the temporary file. Caution: the temporary file must be on
    the same filesystem as the input file.  Contributed by a group of students
    of the University of Paris who were taking the "Understanding of Programs"
    course and wished to gain familiarity with an open-source program.
20
ответ дан 7 August 2018 в 21:59

Начиная с версии 1.7.22, pngcrush имеет параметр перезаписи.

Попробуйте

pngcrush -ow file.png

См. Changelog для получения дополнительной информации :

Version 1.7.22  (built with libpng-1.5.6 and zlib-1.2.5)
  Added "-ow" (overwrite) option.  The input file is overwritten and the
    output file is just used temporarily and removed after it is copied
    over the input file..  If you do not specify an output file, "pngout.png"
    is used as the temporary file. Caution: the temporary file must be on
    the same filesystem as the input file.  Contributed by a group of students
    of the University of Paris who were taking the "Understanding of Programs"
    course and wished to gain familiarity with an open-source program.
20
ответ дан 13 August 2018 в 16:35

Другие вопросы по тегам:

Похожие вопросы: