Skip to content 본문 내용


How to compress PNG images to speed up your website 어떻게 귀하의 웹사이트 속도로 이미지를 PNG로 압축할

리눅스웹 디자인 & 데브

If you have a blog or a website with a lot of content sometimes the images can take a toll on the load time of the pages. 만약 당신이 콘텐츠를 많이 때로는 이미지를 페이지의로드 시간을 피해 갈 수 블로그 또는 웹사이트에있습니다. There are a number of steps you can take to speed things up. 당신이 일을 속도를 위해 취할 수있는 단계의 숫자입니다. If you analyze the loading of your website you might notice that the images take up a huge part of the load time. 만약 당신이 당신이 그 이미지를로드 시간의 큰 부분 소요될 수도 통지 웹사이트의로드를 분석합니다. Let's take a look at how you can compress your .png images to improve on this figure. 어떻게이 그림을 개선하십시오. PNG 이미지를 압축할 수를 살펴보겠습니다.

We'll use the tool pngcrush for this purpose. pngcrush is a free and open source command line tool that, as the name suggests, compresses PNG images. 우리는이 목적을위한 도구 pngcrush 사용됩니다. pngcrush로서 그 이름이 암시, 이미지는 PNG 압축 무료 및 오픈 소스 명령줄 도구입니다. Take a look at the projects 프로젝트에서 봐 website 웹사이트 for detailed information on how to use it. 사용 방법에 대한 자세한 정보가있습니다. We will cover the basics in this article. 우리는이 문서에 기초를 커버한다.

Installation 설치

Most modern distributions of Linux such as Fedora and Ubuntu have pngcrush available directly in their default repositories. 페도 라와 우분투 같은 리눅스의 대부분의 최신 배포판 pngcrush 직접 자신의 기본 저장소에 사용할 수있습니다. So, to install it on you Ubuntu computer execute the following command: 그래서, 당신이 다음과 같은 명령을 실행 우분투 컴퓨터에 설치하려면 :

# sudo apt-get install pngcrush # 쉽다는 sudo - pngcrush 설치 얻을

On Fedora do the following: 페도 라에서 다음을 수행하십시오 :

# yum install pngcrush # 냠 pngcrush 설치

Usage 용도

pngcrush optimizes a PNG graphics file by reducing the size of the files IDAT chunk. pngcrush 최적화 그래픽 IDAT 청크 파일의 크기를 줄임으로써 파일을 PNG로. The process is not simple. 프로세스가 간단하지가 않습니다. The great thing about pngcrush is that the authors of the tool have simplified things for you. pngcrush에 대해 좋은 점은 도구의 저자에 대한 것들을 단순화해야합니다. They ship it with a great option – brute . 그들은 좋은 옵션을 가지고 우주선 - 짐승. When you use this option you effectively tell pngcrush to try and use the most suitable method to compress the image at hand. 언제 당신을 효과적으로 pngcrush하려고 말해 손으로에서 이미지를 압축하는 데 가장 적합한 방법을 사용하는 경우이 옵션을 사용할 수있습니다. There are about 114 different filters that can be used, so this option is mighty useful. 거기에 사용할 수있는 약 114 가지 필터를, 그래서이 옵션은 강력한 유용합니다. Here's how you would use it to compress an image: 여기에 어떻게 이미지를 압축하는 데 사용할 것이라고이 :

# pngcrush -brute -e “.compressed.png” image01.png # pngcrush - 짐승 전자 "."image01.png compressed.png

The two options used here are -brute which I just explained, and -e . 두 가지 옵션이 여기에 사용되고, 난 그냥 어떤 설명, 그리고 짐승 전자. The second option tells pngcrush what extension to add the the filenames. 두 번째 옵션 pngcrush 파일명을 추가하려면 어떻게 확장을 알려줍니다. So after the process of crushing is complete the compressed version of the file image01.png will be called image01.compressed.png . 그래서 후 파일을 image01.png의 압축 버전이 완료되면 분쇄의 과정 image01.compressed.png라는 것입니다. you can change the extension if you like. 만약 당신이 좋아하면 당신은 확장명을 변경할 수있습니다.

You can also slightly modify the above command to compress several PNG files in a directory. 당신은 또한 약간 디렉토리에 여러 개의 PNG 파일을 압축하려면 위의 명령을 수정할 수있습니다. Execute the following command: 다음 명령을 실행합니다 :

# pngcrush -brute -d “/var/www/html/website/images/” *.png # 짐승 pngcrush - d는 "은 / var / www /에서 html로 / 웹사이트 / 이미지 /"*. png로

The above command uses a new option, -d . 위의 명령을 사용하여 새 옵션 - d는. This option tells pngcrush where to place the compressed image files after the compression is complete. 이 옵션은 어디로 압축 후 압축된 이미지 파일을 배치가 완료되면 pngcrush 알려줍니다. The above command will compress all the PNG file in the current directory and place them in /var/www/html/website/images/ . 위의 명령은 현재 디렉토리에있는 모든 PNG 파일을 압축하는 것입니다 그리고 그 장소는 / var / www /에서 html로 / 웹사이트 / 이미지 /.

I strongly suggest that you read up more about this tool and its options on the projects website. 나는 강하게 당신이 도구는 프로젝트 웹사이트에 자사의 옵션에 대한 자세한 내용을 권해드립니다. There are a lot of options that might help you speed up the process of compression or do a better job of it. 거기 당신이 압축 과정의 속도 또는 그것의 더 나은 일을 할 데 도움이 될 옵션이 많이있습니다. Put the new images into your website and watch your pages load faster. 귀하의 웹사이트에 새로운 이미지를 넣고 빨리 귀하의 페이지를 로드할 시계.

Posted in 안으로 배치하는 Linux 리눅스 , , Web Design & Dev 웹 디자인 & 데브 . .

Get Simple Help tutorials just like this one in your email inbox every day - for free! 귀하의 이메일받은 편지로 매일 - 자유에 대한이 하나의 단지처럼 간단한 도움말 튜토리얼 꺼져! Just enter your email address below: 바로 아래에 귀하의 이메일 주소를 입력하십시오 :

You can always opt out of this email subscription at any time. 언제든지이 이메일에 회원 가입을 언제든지 선택할 수있습니다.

0 Responses 0 응답

Stay in touch with the conversation, subscribe to the 숙박 연락 대화와에 가입 RSS feed for comments on this post RSS이 게시물에 덧글에 대한 피드 . .



Some HTML is OK 일부 HTML을 확인합니다

or, reply to this post via 또는,이 게시물에 대한 답장을 통해 trackback 트랙백 . .