mirror of https://github.com/SixLabors/ImageSharp
26 changed files with 436 additions and 267 deletions
@ -0,0 +1,54 @@ |
|||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
|
<PropertyGroup> |
||||
|
<MSBuildCommunityTasksPath>.\</MSBuildCommunityTasksPath> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<Import Project=".\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" /> |
||||
|
|
||||
|
<!-- |
||||
|
**************************************************** |
||||
|
VARIABLES |
||||
|
***************************************************** |
||||
|
--> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<BuildConfiguration>Release</BuildConfiguration> |
||||
|
<BuildFolder>_BuildOutput\</BuildFolder> |
||||
|
<IncludeSymbols>False</IncludeSymbols> |
||||
|
<BuildFolderAbsolutePath>$(MSBuildProjectDirectory)\$(BuildFolder)</BuildFolderAbsolutePath> |
||||
|
<SolutionBinFolderAbsolutePath>$(BuildFolderAbsolutePath)ImageProcessor.Plugins.Cair\lib\net45</SolutionBinFolderAbsolutePath> |
||||
|
<BuildInputDir>..\src\Plugins\ImageProcessor\ImageProcessor.Plugins.Cair\</BuildInputDir> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<!-- |
||||
|
**************************************************** |
||||
|
TARGETS |
||||
|
***************************************************** |
||||
|
--> |
||||
|
|
||||
|
<Target Name="Build" DependsOnTargets="BuildImageProcessorPluginsCair"> |
||||
|
<Message Text="Build finished" /> |
||||
|
</Target> |
||||
|
|
||||
|
<Target Name="BuildImageProcessorPluginsCair" DependsOnTargets="SetVersionNumber"> |
||||
|
<Message Text="Compiling ImageProcessor.Plugins.Cair project to build\$(BuildFolder)" Importance="High" /> |
||||
|
|
||||
|
<MSBuild Projects="$(BuildInputDir)\ImageProcessor.Plugins.Cair.csproj" Properties="WarningLevel=0;Configuration=$(BuildConfiguration);PipelineDependsOnBuild=False;OutDir=$(SolutionBinFolderAbsolutePath);" Targets="Clean;Rebuild;" BuildInParallel="False" ToolsVersion="4.0" UnloadProjectsOnCompletion="False" /> |
||||
|
|
||||
|
<Message Text="Finished compiling project" Importance="High" /> |
||||
|
</Target> |
||||
|
|
||||
|
<Target Name="SetVersionNumber" Condition="'$(BUILD_RELEASE)'!=''"> |
||||
|
<Message Text="Creating Version File: $(BUILD_RELEASE)"/> |
||||
|
<ItemGroup> |
||||
|
<AssemblyFiles Include="$(BuildInputDir)Properties\AssemblyInfo.cs;" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<FileUpdate Files="@(AssemblyFiles)" |
||||
|
Multiline="true" |
||||
|
Singleline="false" |
||||
|
Regex="(AssemblyVersion|AssemblyFileVersionAttribute|AssemblyFileVersion)\("([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)?"\)" |
||||
|
ReplacementText="$1("$(BUILD_RELEASE)")" /> |
||||
|
|
||||
|
</Target> |
||||
|
</Project> |
||||
@ -0,0 +1,37 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> |
||||
|
<metadata> |
||||
|
<id>ImageProcessor.Plugins.Cair</id> |
||||
|
<version>1.0.0.0</version> |
||||
|
<title>ImageProcessor.Plugins.Cair</title> |
||||
|
<authors>James South</authors> |
||||
|
<owners>James South</owners> |
||||
|
<projectUrl>http://imageprocessor.org</projectUrl> |
||||
|
<iconUrl>http://raw.githubusercontent.com/JimBobSquarePants/ImageProcessor/master/build/content/imageprocessor.128.png</iconUrl> |
||||
|
<requireLicenseAcceptance>false</requireLicenseAcceptance> |
||||
|
<description> |
||||
|
Adds support to ImageProcessor for Content Aware Image Resizing. |
||||
|
|
||||
|
If you use ImageProcessor please get in touch via my twitter @james_m_south |
||||
|
|
||||
|
Feedback is always welcome |
||||
|
</description> |
||||
|
<summary>Adds support to ImageProcessor for Content Aware Image Resizing.</summary> |
||||
|
<releaseNotes /> |
||||
|
<copyright>James South</copyright> |
||||
|
<language>en-GB</language> |
||||
|
<tags> |
||||
|
Image Imaging ASP Performance Processing HttpModule Cache Resize AutoRotate Rotate RoundedCorners |
||||
|
Flip Crop Filter Effects Quality Watermark Alpha Vignette Saturation Brightness Contrast Gif Jpg Jpeg |
||||
|
Bitmap Png WebP Tiff Fluent GDI Gaussian Blur Sharpen Tint Quantizer Animated EXIF Cair SeamCarving |
||||
|
</tags> |
||||
|
<dependencies> |
||||
|
<group targetFramework=".NETFramework4.5"> |
||||
|
<dependency id="ImageProcessor" version="2.0.0.0" /> |
||||
|
</group> |
||||
|
</dependencies> |
||||
|
</metadata> |
||||
|
<files> |
||||
|
<file src="..\_BuildOutput\ImageProcessor.Plugins.Cair\lib\net45\ImageProcessor.Plugins.Cair.dll" target="lib\net45\ImageProcessor.Plugins.Cair.dll" /> |
||||
|
</files> |
||||
|
</package> |
||||
@ -1 +1 @@ |
|||||
33f7e25da5675197f18bb2fa2c9fe5fa366e84ec |
c6cb11afaf9fdb9181772246e5c873d8f7d1b99c |
||||
@ -1 +1 @@ |
|||||
f24f17627804b11d823240d49c91ec17fb7fd55d |
10b48cac44776a023df7585ba2c68c3f51b0f803 |
||||
@ -1 +1 @@ |
|||||
def19dd7469cf2eba1f595e7263d9d48fda85825 |
e631eb3491496bb83f99cd41a752f79c9d7f6830 |
||||
@ -1 +1 @@ |
|||||
8cf61b55acca1a3d1a69177ddc439685ee0ba192 |
782056919992bb7e453eeee5d9c0034e03b57506 |
||||
@ -1 +1 @@ |
|||||
629284a6f834f5d1cf185e3603a50c484dd9121a |
1d9ded0201edcd248140b4ec02f69ccdb4b539e5 |
||||
@ -1 +1 @@ |
|||||
3d652e0628f2042e7aca0751384ba21f1182ef5f |
2880457cc09cd2897b5f9f377807ec22f8f83013 |
||||
@ -1 +1 @@ |
|||||
1c48519b2675b9dd90e8e95d6421148b25b8c317 |
34dcced6c7c3e4dd6fae239eba8eddef6234028d |
||||
@ -1 +1 @@ |
|||||
a0aa8338f74f3539c2531f43fa9027a3ce0a39fb |
de6754762f7705f9109ea364f42ca128e454e853 |
||||
@ -1 +1 @@ |
|||||
04f6093d3345a4c8b48333c32972753dd0949730 |
24db72130626e81b9a4262c891dd28e6d97e5a96 |
||||
@ -1 +1 @@ |
|||||
f7b1543810ada7598773d6ee31bc7c0c20afaa9f |
4885438f0b97e3aae59d6e214b5ec455358ae225 |
||||
@ -1,43 +0,0 @@ |
|||||
// --------------------------------------------------------------------------------------------------------------------
|
|
||||
// <copyright file="ContentAwareResizeConvolutionType.cs" company="James South">
|
|
||||
// Copyright (c) James South.
|
|
||||
// Licensed under the Apache License, Version 2.0.
|
|
||||
// </copyright>
|
|
||||
// <summary>
|
|
||||
// Provides enumeration of the content aware resize convolution types.
|
|
||||
// </summary>
|
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
|
||||
|
|
||||
namespace ImageProcessor.Plugins.Cair.Imaging |
|
||||
{ |
|
||||
/// <summary>
|
|
||||
/// Provides enumeration of the content aware resize convolution types.
|
|
||||
/// </summary>
|
|
||||
public enum ContentAwareResizeConvolutionType |
|
||||
{ |
|
||||
/// <summary>
|
|
||||
/// The Prewitt kernel convolution type.
|
|
||||
/// </summary>
|
|
||||
Prewitt = 0, |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The V1 kernel convolution type.
|
|
||||
/// </summary>
|
|
||||
V1 = 1, |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The VSquare kernel convolution type.
|
|
||||
/// </summary>
|
|
||||
VSquare = 2, |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The Sobel kernel convolution type.
|
|
||||
/// </summary>
|
|
||||
Sobel = 3, |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// The Laplacian kernel convolution type.
|
|
||||
/// </summary>
|
|
||||
Laplacian = 4 |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,53 @@ |
|||||
|
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
// <copyright file="OutputType.cs" company="James South">
|
||||
|
// Copyright (c) James South.
|
||||
|
// Licensed under the Apache License, Version 2.0.
|
||||
|
// </copyright>
|
||||
|
// <summary>
|
||||
|
// Enumerates the output type to produce.
|
||||
|
// </summary>
|
||||
|
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
|
||||
|
namespace ImageProcessor.Plugins.Cair.Imaging |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Enumerates the output type to produce.
|
||||
|
/// </summary>
|
||||
|
public enum OutputType |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Output the result as a carved image. The default action.
|
||||
|
/// </summary>
|
||||
|
Cair = 0, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Output the result as a greyscale image.
|
||||
|
/// </summary>
|
||||
|
Grayscale = 1, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Output the result highlighting the detected edges.
|
||||
|
/// </summary>
|
||||
|
Edge = 2, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Output the result highlighting the vertical energy patterns.
|
||||
|
/// </summary>
|
||||
|
VerticalEnergy = 3, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Output the result highlighting the vertical energy patterns.
|
||||
|
/// </summary>
|
||||
|
HorizontalEnergy = 4, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Appears to do nothing.
|
||||
|
/// </summary>
|
||||
|
Removal = 5, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Output the result as a carved image with the focus on high quality output over speed.
|
||||
|
/// </summary>
|
||||
|
CairHighDefinition = 6 |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,41 @@ |
|||||
|
CAIR CLI Usage: |
||||
|
|
||||
|
cair -I <input_file> |
||||
|
|
||||
|
Other options: |
||||
|
-O <output_file> |
||||
|
Default: Dependent on operation |
||||
|
-W <weight_file> |
||||
|
Bitmap with: Black- no weight |
||||
|
Green- Protect weight |
||||
|
Red- Remove weight |
||||
|
Default: Weights are all zero |
||||
|
-S <weight_scale> |
||||
|
Default: 100,000 |
||||
|
-X <goal_x> |
||||
|
Default: Source image width |
||||
|
-Y <goal_y> |
||||
|
Default: Source image height |
||||
|
-R <expected_result> |
||||
|
CAIR: 0 |
||||
|
Grayscale: 1 |
||||
|
Edge: 2 |
||||
|
Vertical Energy: 3 |
||||
|
Horizontal Energy: 4 |
||||
|
Removal: 5 |
||||
|
CAIR_HD: 6 |
||||
|
Default: CAIR |
||||
|
-C <convoluton_type> |
||||
|
Prewitt: 0 |
||||
|
V1: 1 |
||||
|
V_SQUARE: 2 |
||||
|
Sobel: 3 |
||||
|
Laplacian: 4 |
||||
|
Default: Prewitt |
||||
|
|
||||
|
-E <energy_type> |
||||
|
Backward: 0 |
||||
|
Forward: 1 |
||||
|
Default: Backward |
||||
|
-T <thread_count> |
||||
|
Default : CAIR_NUM_THREADS (4) |
||||
Loading…
Reference in new issue