
{"id":4095,"date":"2010-12-09T22:41:03","date_gmt":"2010-12-09T17:11:03","guid":{"rendered":"http:\/\/www.froisa.com\/?p=4095"},"modified":"2010-12-09T22:41:03","modified_gmt":"2010-12-09T17:11:03","slug":"cd-cover-colorize-in-gimp","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2010\/12\/09\/cd-cover-colorize-in-gimp\/","title":{"rendered":"cd cover + colorize in gimp"},"content":{"rendered":"<pre>\nCopyright (C) 1995 Spencer Kimball and Peter Mattis . GPL GIMP colorize.c\n.\n.\n.\n\nvoid\ncolorize (Colorize    *colorize,\n          PixelRegion *srcPR,\n          PixelRegion *destPR)\n{\n  const guchar *src, *s;\n  guchar       *dest, *d;\n  gboolean      alpha;\n  gint          w, h;\n  gint          lum;\n\n  \/*  Set the transfer arrays  (for speed)  *\/\n  h     = srcPR-&gt;h;\n  src   = srcPR-&gt;data;\n  dest  = destPR-&gt;data;\n  alpha = (srcPR-&gt;bytes == 4) ? TRUE : FALSE;\n\n  while (h--)\n    {\n      w = srcPR-&gt;w;\n      s = src;\n      d = dest;\n\n      while (w--)\n        {\n          lum = (colorize-&gt;lum_red_lookup[s[RED_PIX]] +\n                 colorize-&gt;lum_green_lookup[s[GREEN_PIX]] +\n                 colorize-&gt;lum_blue_lookup[s[BLUE_PIX]]); \/* luminosity *\/\n\n          if (colorize-&gt;lightness &gt; 0)\n            {\n              lum = (gdouble) lum * (100.0 - colorize-&gt;lightness) \/ 100.0;\n\n              lum += 255 - (100.0 - colorize-&gt;lightness) * 255.0 \/ 100.0;\n            }\n          else if (colorize-&gt;lightness lightness + 100.0) \/ 100.0;\n            }\n\n          d[RED_PIX]   = colorize-&gt;final_red_lookup[lum];\n          d[GREEN_PIX] = colorize-&gt;final_green_lookup[lum];\n          d[BLUE_PIX]  = colorize-&gt;final_blue_lookup[lum];\n\n          if (alpha)\n            d[ALPHA_PIX] = s[ALPHA_PIX];\n\n          s += srcPR-&gt;bytes;\n          d += destPR-&gt;bytes;\n        }\n\n      src  += srcPR-&gt;rowstride;\n      dest += destPR-&gt;rowstride;\n    }\n}\n<\/pre>\n<p><a href=\"http:\/\/www.jeffgraphics.in\/2010\/12\/09\/cd-cover-colorize-in-gimp\/\">http:\/\/www.jeffgraphics.in\/2010\/12\/09\/cd-cover-colorize-in-gimp\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Copyright (C) 1995 Spencer Kimball and Peter Mattis . GPL GIMP colorize.c . . . void colorize (Colorize *colorize, PixelRegion *srcPR, PixelRegion *destPR) { const guchar *src, *s; guchar *dest, *d; gboolean alpha; gint w, h; gint lum; \/* Set the transfer arrays (for speed) *\/ h = srcPR-&gt;h; src = srcPR-&gt;data; dest = destPR-&gt;data; &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2010\/12\/09\/cd-cover-colorize-in-gimp\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;cd cover + colorize in gimp&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/4095"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=4095"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/4095\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=4095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=4095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=4095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}