From b1997b1223fe0d27e169a363d87901df3444e575 Mon Sep 17 00:00:00 2001
From: "FAZELI SHAHROUDI Sepehr (INTERN)"
 <Sepehr.FAZELISHAHROUDI.intern@3ds.com>
Date: Mon, 24 Mar 2025 21:56:33 +0100
Subject: [PATCH] Edit: Discussion

---
 chapters/5-Discussion.tex | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/chapters/5-Discussion.tex b/chapters/5-Discussion.tex
index a4e62ce..f86226b 100644
--- a/chapters/5-Discussion.tex
+++ b/chapters/5-Discussion.tex
@@ -1,6 +1,6 @@
 \chapter{Discussion}
 
-This chapter interprets the results obtained in the benchmarking experiments, placing them in a broader theoretical and practical context.Explores what the results imply about the efficiency, ease of implementation, licensing concerns, and usability of the evaluated image processing libraries. Furthermore, addresses the larger implications of these findings for software development and image processing as a field.
+This chapter interprets the results obtained in the benchmarking experiments, placing them in a broader theoretical and practical context. It examines the implications of the performance metrics in terms of computational efficiency, implementation complexity, licensing considerations, and the overall usability of the evaluated image processing libraries. Moreover, this discussion extends to address the broader impact these results have on advancements in software engineering and the evolving field of image processing.
 
 \section{Interpreting the Results: Performance vs. Practicality}  
 
@@ -8,11 +8,11 @@ The results obtained from our benchmarking study reveal a clear hierarchy of per
 
 \subsection{Performance Trade-offs and Suitability for Real-World Applications}
 
-From performance standpoint, OpenCvSharp + SkiaSharp and Emgu CV + Structure.Sketching outperform ImageSharp in both image conversion and pixel iteration tasks. However, these libraries require more complex implementations compared to ImageSharp’s user-friendly API. While ImageSharp is slower, it remains a compelling option for projects where ease of use is prioritized over raw speed. SkiaSharp, with its lightweight architecture and cross-platform compatibility, demonstrated remarkable performance in image conversion tasks. It consistently outperformed ImageSharp while consuming significantly less memory. This makes SkiaSharp an ideal choice for applications requiring efficient format conversion without extensive manipulation of individual pixels. Emgu CV, despite its high memory usage, proved to be the fastest option for pixel iteration. This is unsurprising, given its reliance on OpenCV’s highly optimized C++ backend. However, its higher memory footprint may be a drawback for applications running on constrained systems.  Magick.NET, on the other hand, performed well in certain tasks but fell short in pixel iteration due to excessive processing times. This suggests that while Magick.NET is a robust tool for high-quality image manipulation and format conversion, it may not be suitable for performance-critical applications requiring low-latency processing. in graph \ref{fig:image-conversion} and \ref{fig:pixel-iteration} the performance comparison of the libraries in image conversion and pixel iteration tasks respectively can be seen.
+From performance standpoint, OpenCvSharp + SkiaSharp and Emgu CV + Structure.Sketching outperform ImageSharp in both image conversion and pixel iteration tasks. However, ImageSharp showed better memory efficiency during pixel iteration, making it a viable option for applications with limited memory resources. SkiaSharp, with its lightweight architecture and cross-platform compatibility, demonstrated remarkable performance in image conversion tasks. It consistently outperformed ImageSharp while consuming significantly less memory. This makes SkiaSharp an ideal choice for applications requiring efficient format conversion without extensive manipulation of individual pixels. Emgu CV, despite its high memory usage, proved to be the fastest option for pixel iteration. This is unsurprising, given its reliance on OpenCV’s highly optimized C++ backend. However, its higher memory footprint may be a drawback for applications running on constrained systems.  Magick.NET, on the other hand, didn't perform well in both image conversion and pixel iteration tasks. This suggests that while Magick.NET is a robust tool for high-quality image manipulation and format conversion, it may not be suitable for performance-critical applications requiring low-latency processing. in graph \ref{fig:image-conversion} and \ref{fig:pixel-iteration} the performance comparison of the libraries in image conversion and pixel iteration tasks respectively can be seen.
 
 \subsection{The Impact of Licensing on Library Selection}  
 
-Licensing can be a key consideration in selecting an image processing library. The cost of proprietary solutions can be prohibitive, particularly for small businesses or open-source projects. ImageSharp, while powerful, requires a yearly cost of couple of thousand dollars for commercial use.This cost must be weighed against its performance limitations. Open-source alternatives like OpenCvSharp and SkiaSharp, which are licensed under MIT and Apache 2.0 respectively, offer a compelling alternative by providing high performance at no cost. Emgu CV, although based on the open-source OpenCV framework, requires a one-time fee (version specific) of less than thousand dollars, with additional costs for future upgrades. While this is significantly more affordable than ImageSharp, it still represents an investment that must be justified by superior performance. on the other hand,Magick.NET was licensed under Apache 2.0, and provides extensive functionality for free, making it an attractive option for projects that require advanced image processing features but cannot afford proprietary licenses.  
+Licensing can be a key consideration in selecting an image processing library. The cost of proprietary solutions can be prohibitive, particularly for small businesses or open-source projects. ImageSharp, while powerful, requires a yearly cost of a couple of thousand dollars for commercial use. This cost must be weighed against its performance limitations. Open-source alternatives like OpenCvSharp and SkiaSharp, which are licensed under MIT and Apache 2.0 respectively, offer a compelling alternative by providing high performance at no cost. Emgu CV, although based on the open-source OpenCV framework, requires a one-time fee (version specific) of less than thousand dollars, with additional costs for future upgrades. While this is significantly more affordable than ImageSharp, it still represents an investment that must be justified by superior performance. On the other hand, Magick.NET was licensed under Apache 2.0, and provides extensive functionality for free, making it an attractive option for projects that require advanced image processing features but cannot afford proprietary licenses.  
  
 \begin{longtable}
     {|>{\raggedright\arraybackslash}p{0.30\textwidth}|>{\raggedright\arraybackslash}p{0.20\textwidth}|>{\raggedright\arraybackslash}p{0.20\textwidth}|>{\raggedright\arraybackslash}p{0.20\textwidth}|}
@@ -40,14 +40,13 @@ Licensing can be a key consideration in selecting an image processing library. T
 
 \section{Strengths and Weaknesses of the Different Libraries}  
 
-ImageSharp’s biggest advantage is its simple API and pure .NET implementation. It is easy to integrate and requires minimal setup. However, our benchmarks show that it lags behind other libraries in performance. Its relatively high memory efficiency during pixel iteration is a plus, but for tasks requiring fast image conversion or pixel-level modifications, other options are preferable.  
-OpenCvSharp+SkiaSharp: High Performance, Moderate Complexity.This combination provides the best balance between speed and memory efficiency. OpenCvSharp offers the power of OpenCV’s optimized image processing, while SkiaSharp enhances its rendering and format conversion capabilities. However, using these libraries effectively requires familiarity with both OpenCV and SkiaSharp APIs, making them less beginner-friendly than ImageSharp. Emgu CV’s performance in pixel iteration tasks is unmatched, making it ideal for applications involving real-time image analysis, such as AI-driven image recognition. However, its high memory consumption may pose a problem for resource-limited environments. Structure.Sketching complements Emgu CV by providing efficient image creation and drawing capabilities, making this combination well-suited for applications requiring both processing speed and graphical rendering.  In contrast,Magick.NET excels in high-quality image manipulation and resampling but falls short in raw speed. The high processing times recorded for pixel iteration indicate that Magick.NET is best suited for batch processing or scenarios where quality takes precedence over execution time. And MagickScaler, provides advanced image scaling capabilities, making it a valuable tool for applications requiring precise image resizing and enhancement.
+ImageSharp’s biggest advantage is its simple API and pure .NET implementation. It is easy to integrate and requires minimal setup. However, our benchmarks show that it lags behind other libraries in performance. Its relatively high memory efficiency during pixel iteration is a plus, but for tasks requiring fast image conversion or pixel-level modifications, other options are preferable. the combination of OpenCvSharp and SkiaSharp offers a mix of high performance and moderate complexity.This combination provides the best balance between speed and memory efficiency. OpenCvSharp offers the power of OpenCV’s optimized image processing, while SkiaSharp enhances its rendering and format conversion capabilities. However, using these libraries effectively requires familiarity with both OpenCV and SkiaSharp APIs, making them less beginner-friendly than ImageSharp. Emgu CV’s performance in pixel iteration tasks is unmatched, making it ideal for applications involving real-time image analysis, such as AI-driven image recognition. However, its high memory consumption may pose a problem for resource-limited environments. Structure.Sketching complements Emgu CV by providing efficient image creation and drawing capabilities, making this combination well-suited for applications requiring both processing speed and graphical rendering.  In contrast, Magick.NET excels in high-quality image manipulation and resampling but falls short in raw speed. The high processing times recorded for pixel iteration indicate that Magick.NET is best suited for batch processing or scenarios where quality takes precedence over execution time. And MagickScaler, provides advanced image scaling capabilities, making it a valuable tool for applications requiring precise image resizing and enhancement.
 
 Overally There is no single library that is best for all use cases. The optimal choice depends on the application’s specific requirements. If ease of implementation and maintainability are priorities, ImageSharp remains a solid choice despite its performance drawbacks. For performance-intensive applications where raw speed is essential, OpenCvSharp+SkiaSharp or Emgu CV+Structure.Sketching are superior choices.  
   
 \vspace{1em}
 \includegraphics[width=\textwidth]{media/usecase.png}
-\captionof{figure}{Mapping different libraries to their ideal use cases}
+\captionof{figure}{Diagram showing the ideal use cases for each library or library combination based on this study's findings.}
 \label{fig:usecase}
 
 \section{Considerations for Future Research}  
@@ -60,6 +59,10 @@ Future research could explore the following areas to further enhance the capabil
 
 \textbf{Expanding the Scope of Benchmarking:} While our study focused on image conversion and pixel iteration, real-world applications often require additional operations such as filtering, blending, and object detection. Future research could expand the benchmarking scope to include these tasks, providing a more comprehensive evaluation of each library’s capabilities.  
 
+\textbf{Cross-Language Compatibility:} Many image processing libraries are available in multiple programming languages, such as Python, Java, and C++. Investigating the performance of these libraries across different languages could provide valuable insights into the impact of language-specific optimizations on computational efficiency.
+
+\textbf{Format-Specific Performance:} Different image formats have unique compression algorithms and color spaces, which can impact the performance of image processing libraries. Future research could investigate how each library performs with specific formats, such as TIFF, BMP, or PNG, to identify any format-specific optimizations or bottlenecks.
+
 \textbf{GPU Acceleration and Parallel Processing:} One limitation of our study is that all benchmarks were conducted on a CPU. Many modern image processing tasks benefit from GPU acceleration, which libraries like OpenCV support. Investigating the performance of these libraries on GPU-accelerated hardware could yield valuable insights into their scalability and efficiency.  
 
 \textbf{Cloud-Based Processing:} With the growing adoption of cloud computing, it would be beneficial to evaluate how these libraries perform in cloud-based environments such as AWS Lambda or Azure Functions. Factors such as cold start times, scalability, and integration with cloud-based storage solutions would be critical considerations for enterprise applications.  
-- 
GitLab