이미지매직으로 그림을 바꾸려고 합니다.

pamisu1의 이미지

만약 제가 24비트 압축되지 않은 비트맵을 만든다면

convert -compress none -depth 24 a.gif a.bmp 란 옵션이 맞는지요?

만약 맞다면 png 파일도 아래와 같은 명령으로 마찬가지로 만들 수 있는지 궁금합니다.
convert -compress none -depth 24 a.gif a.png

feanor의 이미지

그런 식으로 사용하시는 게 맞습니다. 물론 png도 잘 됩니다.

다만 -depth는 색깔의 비트 수인데, 정말로 24비트가 필요한가요? 색깔별로 24비트라면 RGB 형식이면 한 픽셀에 72비트가 됩니다. RGB 형식에서 한 픽셀에 24비트(#000000부터 #ffffff까지)를 얻으려면 -depth 8을 쓰셔야 합니다.

Prentice의 이미지

http://www.imagemagick.org/script/command-line-options.php#depth

여기만 봐서는 이미지의, 혹은 픽셀 전체의 bit-depth 같아보입니다.

feanor의 이미지

직접 해보시면 알 수 있습니다. :)

문서에도 "This is the number of bits in a color sample within a pixel."이라고 되어 있는데, 픽셀의 컬러 샘플의 bit-depth이지 픽셀의 bit-depth가 아니라는 뜻입니다.

Prentice의 이미지

직접 해봤지만 24bit(?) JPEG 파일은 -depth 8을 써도 -depth 3을 써도 -depth 16을 써도 24bit PNG, 24bit BMP로 변환되었습니다.

Win32용 ImageMagick 6.3.6 Q16이였고.. 제가 잘못한 것일지도 모르겠지만 저는 문서에 “[D]epth of the image.”라고 나와있는 것을 보고 적었던 것입니다.. ;)

pamisu1의 이미지

제가 윈도우의 그림판에서 그림파일을 열어서 다른 이름으로 저장할 때 24비트 비트맵 형식으로
저장한 a.bmp 파일은

jfbterm-0.4.7-uxp-0.2.0 이 설치된 가상콘솔에서 배경그림으로 잘 나옵니다.

하지만 이미지 매직의 convert -compress None -depth 8 a.gif a-8.bmp로 만든
파일은 가상콘솔상에 배경그림으로 나오질 않습니다.

뭔가 다른 옵션이 더 필요한 것 아닌지요?

그리고 만약 이미지매직에서 16비트 그림으로 변환하려면 어떻게 합니까?
-depth 5 라고 주면 15비트가 되잖아요.

feanor의 이미지

16비트 비트맵이라고 하는 것은 RGB를 5:6:5비트로 사용하는 포맷입니다. 이미지매직은 색깔마다 다른 비트 수를 사용하는 포맷을 읽을 수는 있지만 쓰지는 못합니다.

아래 메일을 참고하세요.
http://www.imagemagick.org/pipermail/magick-users/2005-July/015802.html

bushi의 이미지

[bushi@rose jfbterm-0.4.7-uxp-0.2.0]$ 
[bushi@rose jfbterm-0.4.7-uxp-0.2.0]$ file a.gif
a.gif: GIF image data, version 89a, 229 x 20
[bushi@rose jfbterm-0.4.7-uxp-0.2.0]$ 
[bushi@rose jfbterm-0.4.7-uxp-0.2.0]$ convert a.gif a.bmp
[bushi@rose jfbterm-0.4.7-uxp-0.2.0]$ file a.bmp 
a.bmp: PC bitmap data
[bushi@rose jfbterm-0.4.7-uxp-0.2.0]$ 
[bushi@rose jfbterm-0.4.7-uxp-0.2.0]$ giftopnm a.gif > a.pnm
[bushi@rose jfbterm-0.4.7-uxp-0.2.0]$ convert a.pnm a.bmp
[bushi@rose jfbterm-0.4.7-uxp-0.2.0]$ file a.bmp
a.bmp: PC bitmap data, Windows 3.x format, 229 x 20 x 24
[bushi@rose jfbterm-0.4.7-uxp-0.2.0]$ 

gif89a 이후 포맷을 제대로 처리하지 못하는 듯 보입니다.
(그런데, display 로는 잘 보인단 말이죠...)

OTL

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.