<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="315862" data-post-id="315862">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="MatijaL" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  MatijaL
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’ve tried it in <code>iex</code> and everything works just fine. The file was always successfully created  even before, but it crashes right after it. I suspect it’s related to LiveView Upload somehow. Thanks for your help, I’ll try to identify what’s causing it.</p>
<p>Edit: using <code>Image.thumbnail/3</code> without <code>Image.open()</code> and <code>Image.write()</code> fixed the issue.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="315862" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/image-an-image-processing-library-based-upon-vix/47568/143">Post #142</a>
	                </div>
	            </div>
              <div id="likers-container-315862" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="315862"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #142"></div>
  </section>
</div>
    <div class="postbit" id="319260" data-post-id="319260">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’ve just published <a href="https://hex.pm/packages/image/0.43.0" rel="nofollow">Image version 0.43.0</a>. It has some breaking changes (rename functions in nearly all cases). This brings the code a lot close to a <code>1.0</code> release. The remaining issue is to complete the re-write of the color handling code over the next couple of months.</p>
<h3><a name="p-319260-image-version-0430-changelog-1" class="anchor" href="#p-319260-image-version-0430-changelog-1" aria-label="Heading link" rel="nofollow"></a>Image version 0.43.0 changelog</h3>
<h3><a name="p-319260-breaking-changes-2" class="anchor" href="#p-319260-breaking-changes-2" aria-label="Heading link" rel="nofollow"></a>Breaking Changes</h3>
<ul>
<li>
<p><code>Image.erode/2</code> and <code>Image.dilate/2</code> now take a <code>radius</code> parameter rather than a <code>pixels</code> parameter. Both functions have been refactored to allow a radius in the range <code>1..5</code> with a default of <code>1</code>. The radius represents the dimension of the matrix used in the <code>Vix.Vips.Operations.range/4</code> function that underpins dilation and erosion. As such they represent the <em>approximate</em> number of pixels eroded or dilated.  In addition, this function now results in a single <code>libvips</code> operation. The previous implementation created <code>n</code> operations (where <code>n</code> was the value of the <code>pixels</code> param) that could result in a slow imaging pipeline and in some cases a <a href="https://github.com/elixir-image/image/issues/125" rel="nofollow">segfault of the entire VM due to stack space exhaustion in libvips</a>.</p>
</li>
<li>
<p>The signature for <code>Image.linear_gradient/{1..3}</code> has changed.  The function now takes:</p>
<ul>
<li>An image and an optional keyword list of options</li>
<li>A width and height as numbers and a keyword list of options</li>
</ul>
</li>
<li>
<p><code>Image.dominant_color/2</code> now returns an <code>{:ok, rgb_color}</code> tuple rather than a <code>[r, g, b]</code> list. Use <code>Image.dominant_color!/2</code> if only the color value return is required.</p>
</li>
<li>
<p><code>Image.map_pages/2</code> is deprecated in favour of <code>Image.map_join_pages/2</code> to better reflect the intent of the function.</p>
</li>
</ul>
<h3><a name="p-319260-enhancements-3" class="anchor" href="#p-319260-enhancements-3" aria-label="Heading link" rel="nofollow"></a>Enhancements</h3>
<ul>
<li>
<p><code>Image.linear_gradient/{1..3}</code> now takes an <code>:angle</code> option which determines the angle of the gradient in degrees. Thanks to <span class="mention">@severian1778</span> for considerable patience. Closes <span class="hashtag-raw">#67</span>.</p>
</li>
<li>
<p>Improve options handling and documentation for <code>Image.radial_gradient/3</code>.</p>
</li>
<li>
<p>Add <code>Image.radial_gradient!/3</code> to mirror <code>Image.radial_gradient/3</code>.</p>
</li>
<li>
<p>Add <code>Image.dominant_color!/2</code> to mirror <code>Image.dominant_color/2</code>.</p>
</li>
<li>
<p>Add <code>Image.extract_pages/1</code> which will extract the pages of a multi-page image into a list of separate images.</p>
</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="319260" data-batch-url="/posts/batch_likers">
                        9
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/image-an-image-processing-library-based-upon-vix/47568/144">Post #143</a>
	                </div>
	            </div>
              <div id="likers-container-319260" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="319260"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #143"></div>
  </section>
</div>
    <div class="postbit" id="327234" data-post-id="327234">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’ve published <a href="https://hex.pm/packages/image/0.45.0" rel="nofollow">Image version 0.45.0</a>.  <strong>Please note this includes a breaking change</strong> for how images from text are rendered. For most (maybe all?) current use cases the change may not be visible.  Since I didn’t post an announcement for Image 0.44.0 I’m including that changelog here now too.</p>
<h3><a name="p-327234-breaking-changes-1" class="anchor" href="#p-327234-breaking-changes-1" aria-label="Heading link" rel="nofollow"></a>Breaking changes</h3>
<p>The implementations of <code>Image.text/2</code> and <code>Image.simple_text/2</code> have been simplified to use only the built-in Pango renderer. A bug in font sizing using the Pango renderer has also been fixed. As a result, there may be some small visual differences between text images generated by Image 0.45.0 compared to previous releases.</p>
<ul>
<li>
<p><code>Image.text/2</code> now uses only the built-in <a href="https://docs.gtk.org/Pango/pango_markup.html" rel="nofollow">Pango</a> renderer for all use cases. SVG is not nhow used for any rendering in <code>Image.text/2</code> or <code>Image.simple_text/2</code>. This gives a more consistent output and less ambiguity. However as a result, a small number of options are no longer available since they cannot be honoured by Pango:</p>
<ul>
<li>
<p><code>:text_stroke_color</code></p>
</li>
<li>
<p><code>:text_stroke_width</code></p>
</li>
</ul>
</li>
<li>
<p>The <code>:autofit</code> option to <code>Image.text/2</code> is also removed. The autofit capability is now controlled by whether the <code>:width</code> and/or <code>:height</code> options are provided.</p>
</li>
<li>
<p>Some other options are now treated differently in <code>Image.text/2</code>:</p>
<ul>
<li><code>:width</code> and <code>:height</code> are now truly optional. If ommitted, the renderer will calculate the required image size based upon the other options. It is acceptable to specify <code>:width</code> and omit <code>:height</code> in which case the maximum width is fixed and the height is variable.</li>
</ul>
</li>
</ul>
<h3><a name="p-327234-bug-fixes-2" class="anchor" href="#p-327234-bug-fixes-2" aria-label="Heading link" rel="nofollow"></a>Bug Fixes</h3>
<ul>
<li>
<p>Fix warnings on upcoming Elixir 1.17.</p>
</li>
<li>
<p>A bug resulting in incorrect font sizing with using the Pango renderer has been fixed. Font sizing is now very similar to the sizing of the previously used SVG renderer.</p>
</li>
</ul>
<h3><a name="p-327234-enhancements-image-0440-3" class="anchor" href="#p-327234-enhancements-image-0440-3" aria-label="Heading link" rel="nofollow"></a>Enhancements (Image 0.44.0)</h3>
<ul>
<li>Adds <code>Image.Blurhash.encode/2</code> and <code>Image.Blurhash.decode/1</code> to encode and decode <a href="https://blurha.sh" rel="nofollow">blurhashes</a>. Based upon a fork of <a href="https://github.com/rinpatch/blurhash" rel="nofollow">rinpatch_blurhash</a>. Thanks to <a class="mention" href="/u/stiang" rel="nofollow">@stiang</a> for the suggestion. Thanks very much to <span class="mention">@rinpatch</span> for the implementation.</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="327234" data-batch-url="/posts/batch_likers">
                        8
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/image-an-image-processing-library-based-upon-vix/47568/145">Post #144</a>
	                </div>
	            </div>
              <div id="likers-container-327234" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="327234"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #144"></div>
  </section>
</div>
    <div class="postbit" id="327237" data-post-id="327237">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sodapopcan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/120/34668_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sodapopcan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Blurhash is a really nice addition!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="327237" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/image-an-image-processing-library-based-upon-vix/47568/146">Post #145</a>
	                </div>
	            </div>
              <div id="likers-container-327237" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="327237"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #145"></div>
  </section>
</div>
    <div class="postbit" id="329273" data-post-id="329273">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="willc0de4food" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/willc0de4food/120/31975_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  willc0de4food
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Is it possible to stream the upload back up to S3 with a different path? The example uses <code>conn</code>, but I’m planning on doing image processing in the background. So it would stream the file from an S3 bucket, resize it, then stream it back. Here’s what I attempted, but this isn’t working:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  def resize_image(photo) do
    image_path = "processed/#{photo.image}"

    S3.download_file(bucket(), photo.image, :memory)
    |&gt; ExAws.stream!()
    |&gt; Image.open!()
    |&gt; Image.resize!(1280)
    |&gt; Image.stream!(suffix: ".jpg")
    |&gt; S3.upload(bucket(), image_path)
    |&gt; ExAws.request()
end
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="329273" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/image-an-image-processing-library-based-upon-vix/47568/147">Post #146</a>
	                </div>
	            </div>
              <div id="likers-container-329273" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="329273"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #146"></div>
  </section>
</div>
    <div class="postbit" id="329274" data-post-id="329274">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Yes, that’s possible. I’m only on mobile now for the next few hours so pardon the brevity. There is a test which does exactly that - stream from AWS and then back to AWS. I’d suggest take a look at that if you can - and I’ll revert here again when I’m properly back online.</p>
<p>Edit: the test is here: <a href="https://github.com/elixir-image/image/blob/main/test/stream_image_test.exs#L162" class="inline-onebox" rel="nofollow">image/test/stream_image_test.exs at main · elixir-image/image · GitHub</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="329274" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/image-an-image-processing-library-based-upon-vix/47568/148">Post #147</a>
	                </div>
	            </div>
              <div id="likers-container-329274" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="329274"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #147"></div>
  </section>
</div>
    <div class="postbit" id="329276" data-post-id="329276">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="willc0de4food" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/willc0de4food/120/31975_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  willc0de4food
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Ok, so that’s basically exactly what I was already doing. I’ve tried the code line by line, and the error happens with <code>ExAws.request()</code>. Does this indicate to you what I’ve done wrong?</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">** (Vix.Vips.Image.Error) Failed to write to target
    (vix 0.27.0) lib/vix/vips/image.ex:568: anonymous fn/1 in Vix.Vips.Image.write_to_stream/2
    (elixir 1.16.2) lib/stream.ex:1626: Stream.do_resource/5
    (elixir 1.16.2) lib/stream.ex:1828: Enumerable.Stream.do_each/4
    (elixir 1.16.2) lib/task/supervised.ex:339: Task.Supervised.stream_reduce/7
    (elixir 1.16.2) lib/enum.ex:4396: Enum.map/2
    (ex_aws_s3 2.5.3) lib/ex_aws/s3/upload.ex:141: ExAws.Operation.ExAws.S3.Upload.perform/2
    iex:14: (file)
</code></pre>
<p>The S3 download works, and I have S3 upload working elsewhere, so I can confirm <code>ExAws</code> is configured correctly..</p>
<p>// Edit<br>
So I think the problem is I was using <code>.resize!()</code> with a number of pixels, and not with a scale.<br>
Using <code>.thumbnail!()</code> instead works.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="329276" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/image-an-image-processing-library-based-upon-vix/47568/149">Post #148</a>
	                </div>
	            </div>
              <div id="likers-container-329276" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="329276"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #148"></div>
  </section>
</div>
    <div class="postbit" id="329282" data-post-id="329282">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Ah, indeed - <code>Image.resize/2</code> takes an argument that is a factor. So you were resizing the image to be <code>1_280</code> times larger than the original. Which would be extremely large - but I still don’t think it should fail.  I’ll reproduce using <code>Vix</code> functions only and open an issue there so we can get <a class="mention" href="/u/akash-akya" rel="nofollow">@akash-akya</a>’s opinion.</p>
<p><code>Image.thumbnail/2</code> is definitely the correct function for resizing images.  I know the naming can cause some confusion. I am reflecting the underlying <code>libvips</code> function names. Perhaps thats not the right strategy in this case?</p>
<p>The other thing to note is that AWS (native AWS) requires a minimum chunk size for a stream which is <code>5MB</code>. Therefore I would recommend adding the <code>:buffer_size</code> option to <code>Image.stream/2</code>. For example:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">@s3_buffer_size 5 * 1024 * 1024
...
|&gt; Image.stream!(suffix: ".jpg", buffer_size: @s3_buffer_size)
...
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="329282" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/image-an-image-processing-library-based-upon-vix/47568/150">Post #149</a>
	                </div>
	            </div>
              <div id="likers-container-329282" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="329282"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #149"></div>
  </section>
</div>
    <div class="postbit" id="329327" data-post-id="329327">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="willc0de4food" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/willc0de4food/120/31975_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  willc0de4food
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Sounds good. And yeah, an image 1280x would be quite large.<br>
The naming convention wasn’t very intuitive for me, I thought thumbnail was oddly specific, and assumed what it did without looking at the docs. I wanted to resize the image, so that’s the function I tried. Next time I will RTFM first <img src="https://forum.elixirforum.com/images/emoji/apple/sweat_smile.png?v=15" title=":sweat_smile:" class="emoji" alt=":sweat_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="329327" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/image-an-image-processing-library-based-upon-vix/47568/151">Post #150</a>
	                </div>
	            </div>
              <div id="likers-container-329327" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="329327"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #150"></div>
  </section>
</div>
    <div class="postbit" id="329777" data-post-id="329777">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’ve published <a href="https://hex.pm/packages/image/0.48" rel="nofollow">Image 0.48.0</a> today. It’s only a small update that adds <code>:model_options</code>, <code>:featurizer_options</code> and <code>:batch_size</code> as configuration options to the built in convenience image classifier.</p>
<p>The result is that <code>Image</code> can enable a wider range of <a href="https://huggingface.co" rel="nofollow">HuggingFace</a> models to be used quickly.</p>
<h4><a name="p-329777-detecting-nsfw-images-1" class="anchor" href="#p-329777-detecting-nsfw-images-1" aria-label="Heading link" rel="nofollow"></a>Detecting NSFW images</h4>
<p>In collaboration with <a class="mention" href="/u/willc0de4food" rel="nofollow">@willc0de4food</a>, here’s an example using the <a href="https://huggingface.co/Falconsai/nsfw_image_detection" rel="nofollow">Falconsai/nsfw_image_detection</a> model:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex&gt; image = Image.open!("./test/support/images/jose.png")
%Vix.Vips.Image{ref: #Reference&lt;0.185418317.1571422244.223902&gt;}
iex&gt; Image.Classification.classify(image)
%{
  predictions: [
    %{label: "normal", score: 0.9998503923416138},
    %{label: "nsfw", score: 1.495583273936063e-4}
  ]
}
</code></pre>
<p>I suspect NSFW image detection is quite useful in a lot of applications so I hope the config options are helpful.</p>
<h4><a name="p-329777-image-classification-config-2" class="anchor" href="#p-329777-image-classification-config-2" aria-label="Heading link" rel="nofollow"></a>Image classification config</h4>
<p>The example above is configured in <code>runtime.exs</code> as follows:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">config :image, :classifier,
  model: {:hf, "Falconsai/nsfw_image_detection"},
  featurizer: {:hf, "Falconsai/nsfw_image_detection"},
  featurizer_options: [module: Bumblebee.Vision.VitFeaturizer],
  name: Image.Classification.Server,
  autostart: true
</code></pre>
<h4><a name="p-329777-limitations-of-image-classification-in-image-3" class="anchor" href="#p-329777-limitations-of-image-classification-in-image-3" aria-label="Heading link" rel="nofollow"></a>Limitations of Image classification in Image</h4>
<p>Image wraps an optional Bumblebee/Nx server to make it easy to onboard image classification capabilities without having to immediately learn how to set up the Bumblebee/Nx infrastructure efficiently.</p>
<p>It’s not intended to be a complete solution for more complex production requirements which should use Bumblebee/Axon/Nx directly. The documentation has been updated to make that clearer.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="329777" data-batch-url="/posts/batch_likers">
                        8
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/image-an-image-processing-library-based-upon-vix/47568/152">Post #151</a>
	                </div>
	            </div>
              <div id="likers-container-329777" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="329777"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #151"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/47568/load_more?page=16">Load more posts (44 remaining)</a>
</div></template></turbo-stream>