<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: images code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 24 Jul 2008 02:42:43 GMT</pubDate>
    <description>DZone Snippets: images code</description>
    <item>
      <title>Howto resize multiple pictures, graphics, images</title>
      <link>http://snippets.dzone.com/posts/show/5440</link>
      <description>&lt;code&gt;&lt;br /&gt;for k in $(ls *.jpg); do convert -resize 800 -quality 80 $k r800-$k; done&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 29 Apr 2008 16:41:33 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5440</guid>
      <author>flynets (Flynets is an italian student of computer science with passion for GNU/Linux and hacktivism.)</author>
    </item>
    <item>
      <title>text input /w background image</title>
      <link>http://snippets.dzone.com/posts/show/4444</link>
      <description>// self-explanatory. see title.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.searchBox{&lt;br /&gt;  background-image:url('http://www.dhtmlgoodies.com/tips-and-tricks/input-with-background/images/magnifying-glass.gif');&lt;br /&gt;  background-repeat:no-repeat;&lt;br /&gt;  padding-left:20px;&lt;br /&gt;}&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;input type="text" name="search" style="border:2px inset gray;color:black;background-color:lightyellow;font-family:arial narrow;font-weight:bold;font-size:9pt;" class="searchBox"&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 22 Aug 2007 14:43:56 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4444</guid>
      <author>thescriptkeeper (mona)</author>
    </item>
    <item>
      <title>Image aggregator</title>
      <link>http://snippets.dzone.com/posts/show/4259</link>
      <description>This PHP snippet outputs the contents of a table (beginning &amp; ending tags not included) containing all the images from the current directory.&lt;br /&gt;&lt;code&gt;&lt;?PHP&lt;br /&gt; $columns = 3;&lt;br /&gt; $im = glob("*.{gif,jpg,png}", GLOB_BRACE);&lt;br /&gt; $rows = ceil(count($im) / $columns);&lt;br /&gt; for ($i = 0; $i &lt; $rows; $i++) {&lt;br /&gt;  echo "\n&lt;TR&gt;";&lt;br /&gt;  for ($j = $columns*$i; isset($im[$j]) &amp;&amp; $j - $columns*$i &lt; $columns; $j++) {&lt;br /&gt;   echo "&lt;TD&gt;$im[$j]&lt;BR&gt;&lt;IMG SRC='$im[$j]'&gt;&lt;/TD&gt;";&lt;br /&gt;  }&lt;br /&gt;  echo "&lt;/TR&gt;";&lt;br /&gt; }&lt;br /&gt;?&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 05 Jul 2007 04:08:17 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4259</guid>
      <author>Minimiscience (Guildorn Tanaleth)</author>
    </item>
    <item>
      <title>Java - Erode</title>
      <link>http://snippets.dzone.com/posts/show/2974</link>
      <description>// JAI Filter erode&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;public RenderedImage erode(BufferedImage img)&lt;br /&gt;	{&lt;br /&gt;		KernelJAI kernel = new KernelJAI(7, 7, new float[]{&lt;br /&gt;															0, 0, 0, 0, 0, 0, 0,&lt;br /&gt;															0, 1, 1, 1, 1, 1, 0,&lt;br /&gt;															0, 1, 1, 1, 1, 1, 0,&lt;br /&gt;															0, 1, 1, 1, 1, 1, 0,&lt;br /&gt;															0, 1, 1, 1, 1, 1, 0,&lt;br /&gt;															0, 1, 1, 1, 1, 1, 0,&lt;br /&gt;															0, 0, 0, 0, 0, 0, 0&lt;br /&gt;															});&lt;br /&gt;		ParameterBlock pb = new ParameterBlock();&lt;br /&gt;		pb.addSource(img);&lt;br /&gt;		pb.add(kernel);&lt;br /&gt;		&lt;br /&gt;		return JAI.create("erode", pb);&lt;br /&gt;	}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 05 Nov 2006 19:27:14 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2974</guid>
      <author>whitetiger ()</author>
    </item>
    <item>
      <title>Java - subTraction</title>
      <link>http://snippets.dzone.com/posts/show/2973</link>
      <description>// Use JAI filter&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;public RenderedImage subTraction(BufferedImage img1, BufferedImage img2)&lt;br /&gt;	{&lt;br /&gt;		ParameterBlock pb = new ParameterBlock();&lt;br /&gt;		pb.addSource(img1);&lt;br /&gt;		pb.addSource(img2);&lt;br /&gt;		&lt;br /&gt;		return JAI.create("subtract", pb);&lt;br /&gt;	}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 05 Nov 2006 16:23:01 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2973</guid>
      <author>whitetiger ()</author>
    </item>
    <item>
      <title>Java - showBitPlanes</title>
      <link>http://snippets.dzone.com/posts/show/2970</link>
      <description>// the input it must be a b/w image&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;public BufferedImage showBitPlanes(BufferedImage bi, int lv)&lt;br /&gt;	{&lt;br /&gt;		int level = 0;&lt;br /&gt;		&lt;br /&gt;		switch(level)&lt;br /&gt;		{&lt;br /&gt;			case 0:&lt;br /&gt;				level = 128;&lt;br /&gt;				break;&lt;br /&gt;			case 1:&lt;br /&gt;				level = 64;&lt;br /&gt;				break;&lt;br /&gt;			case 2:&lt;br /&gt;				level = 32;&lt;br /&gt;				break;&lt;br /&gt;			case 3:&lt;br /&gt;				level = 16;&lt;br /&gt;				break;&lt;br /&gt;			case 4:&lt;br /&gt;				level = 8;&lt;br /&gt;				break;&lt;br /&gt;			case 5:&lt;br /&gt;				level = 4;&lt;br /&gt;				break;&lt;br /&gt;			case 6:&lt;br /&gt;				level = 2;&lt;br /&gt;				break;&lt;br /&gt;			case 7:&lt;br /&gt;				level = 1;&lt;br /&gt;				break;&lt;br /&gt;			default:&lt;br /&gt;					return null;&lt;br /&gt;		}&lt;br /&gt;		&lt;br /&gt;		int width = bi.getWidth();&lt;br /&gt;		int height = bi.getHeight();&lt;br /&gt;		&lt;br /&gt;		BufferedImage img = new BufferedImage(width, height, bi.getType());&lt;br /&gt;		&lt;br /&gt;		for(int x=0; x&lt;width; x++)&lt;br /&gt;			for(int y=0; y&lt;height; y++)&lt;br /&gt;				img.setRGB(x, y, ((bi.getRGB(x, y) &amp; level)/level)*255);&lt;br /&gt;		&lt;br /&gt;		return img;&lt;br /&gt;	}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 05 Nov 2006 00:41:29 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2970</guid>
      <author>whitetiger ()</author>
    </item>
    <item>
      <title>Matlab - showBitPlanes</title>
      <link>http://snippets.dzone.com/posts/show/2969</link>
      <description>&lt;code&gt;&lt;br /&gt;% Ritorna i Bit Plabes dell'immagine a toni di grigio&lt;br /&gt;&lt;br /&gt;function showBitPlanes(img)&lt;br /&gt;&lt;br /&gt;    imgGray = double( rgb2gray(img) );&lt;br /&gt;    titleString = 'bit planes ';&lt;br /&gt;    &lt;br /&gt;    % MSB ... LSB&lt;br /&gt;    k = 128;&lt;br /&gt;    &lt;br /&gt;    for b=1:8&lt;br /&gt;        &lt;br /&gt;        subplot(2, 4, b);&lt;br /&gt;        imshow( (bitand(imgGray, k) / k) * 255 ); % Fa un and dei bit&lt;br /&gt;        title([titleString int2str(b-1)]);&lt;br /&gt;        k = k/2; % Shifta di 2 i bit&lt;br /&gt;        &lt;br /&gt;    end;&lt;br /&gt;    &lt;br /&gt;return;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 05 Nov 2006 00:16:40 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2969</guid>
      <author>whitetiger ()</author>
    </item>
    <item>
      <title>Java - Dilate3</title>
      <link>http://snippets.dzone.com/posts/show/2968</link>
      <description>// pixel before the filter&lt;br /&gt;// |--|--|--|&lt;br /&gt;// |  |  |  |&lt;br /&gt;// |--|--|--|&lt;br /&gt;// |  | *|  |&lt;br /&gt;// |--|--|--|&lt;br /&gt;// |  |  |  |&lt;br /&gt;// |--|--|--|&lt;br /&gt;&lt;br /&gt;// pixel after the filter&lt;br /&gt;// |--|--|--|&lt;br /&gt;// | *| *| *|&lt;br /&gt;// |--|--|--|&lt;br /&gt;// | *| *| *|&lt;br /&gt;// |--|--|--|&lt;br /&gt;// | *| *| *|&lt;br /&gt;// |--|--|--|&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;public BufferedImage dilate3(BufferedImage bi)&lt;br /&gt;	{&lt;br /&gt;		BufferedImage buff = new BufferedImage(bi.getWidth(), bi.getHeight(), bi.getType());&lt;br /&gt;		&lt;br /&gt;		Kernel kernel = new Kernel(3, 3, new float[] {&lt;br /&gt;														1f, 1f, 1f, &lt;br /&gt;														1f, 1f, 1f, &lt;br /&gt;														1f, 1f, 1f&lt;br /&gt;													 });&lt;br /&gt;		&lt;br /&gt;		ConvolveOp op = new ConvolveOp(kernel);&lt;br /&gt;		op.filter(bi, buff);&lt;br /&gt;		&lt;br /&gt;		return buff;&lt;br /&gt;	}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 04 Nov 2006 23:19:27 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2968</guid>
      <author>whitetiger ()</author>
    </item>
    <item>
      <title>Java - EdgeW / EdgeH</title>
      <link>http://snippets.dzone.com/posts/show/2965</link>
      <description>&lt;code&gt;&lt;br /&gt;public BufferedImage EdgeW(BufferedImage bi)&lt;br /&gt;	{&lt;br /&gt;		BufferedImage buff = new BufferedImage(bi.getWidth(), bi.getHeight(), bi.getType());&lt;br /&gt;		&lt;br /&gt;		Kernel kernel = new Kernel(3, 3, new float[] {&lt;br /&gt;														-1f, 0f, 1f, &lt;br /&gt;														-2f, 0f, 2f, &lt;br /&gt;														-1f, 0f, 1f&lt;br /&gt;													 });&lt;br /&gt;		&lt;br /&gt;		ConvolveOp op = new ConvolveOp(kernel);&lt;br /&gt;		op.filter(bi, buff);&lt;br /&gt;		&lt;br /&gt;		return buff;&lt;br /&gt;	}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;	public BufferedImage EdgeH(BufferedImage bi)&lt;br /&gt;	{&lt;br /&gt;		BufferedImage buff = new BufferedImage(bi.getWidth(), bi.getHeight(), bi.getType());&lt;br /&gt;		&lt;br /&gt;		Kernel kernel = new Kernel(3, 3, new float[] {&lt;br /&gt;														-1f, -2f, -1f, &lt;br /&gt;														 0f,  0f,  0f, &lt;br /&gt;														 1f,  2f,   1f&lt;br /&gt;													 });&lt;br /&gt;		&lt;br /&gt;		ConvolveOp op = new ConvolveOp(kernel);&lt;br /&gt;		op.filter(bi, buff);&lt;br /&gt;		&lt;br /&gt;		return buff;&lt;br /&gt;	}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 04 Nov 2006 00:23:26 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2965</guid>
      <author>whitetiger ()</author>
    </item>
    <item>
      <title>Java - Brightness</title>
      <link>http://snippets.dzone.com/posts/show/2961</link>
      <description>&lt;code&gt;&lt;br /&gt;public BufferedImage brightness(BufferedImage bi, float value)&lt;br /&gt;	{&lt;br /&gt;		BufferedImage buff = new BufferedImage(bi.getWidth(), bi.getHeight(), bi.getType());&lt;br /&gt;		&lt;br /&gt;		Kernel kernel = new Kernel(1, 1, new float[] {value});&lt;br /&gt;		&lt;br /&gt;		ConvolveOp op = new ConvolveOp(kernel);&lt;br /&gt;		op.filter(bi, buff);&lt;br /&gt;		&lt;br /&gt;		return buff;&lt;br /&gt;	}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 03 Nov 2006 13:21:49 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2961</guid>
      <author>whitetiger ()</author>
    </item>
  </channel>
</rss>
