我得到了一个jpeg图像,其中1020x780,我试图将其调整为111x85(这是比例),但它出现像素化.
我只是尝试过
a)将图像分配给TImage组件并设置Scaled/Resize属性.
b)这里的调整大小代码http://www.delphigroups.info/2/4/313095.html
c)这里的调整大小代码http://www.swissdelphicenter.ch/torry/showcode.php?id=1896
然而,他们都出现像素化.
如果我在Photoshop中调整大小,那就好了.获得好处将是理想的,但是我知道他们花了很多时间/代码来调整大小,所以甚至中间的东西也会很棒.
有什么建议?
我正在使用ASP.NET网页创建一个表单,我可以在其中选择图像.我想将图像调整为各种不同的大小,以便我可以在我的网站上显示它们.
这适用于较小的图像(在文件大小),但我想要调整大小的图像来自我的数码单反相机,它们可以大到每个jpeg 14MB.我收到以下错误...
Maximum request length exceeded.
Run Code Online (Sandbox Code Playgroud)
我添加了web.config以下代码:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="false" targetFramework="4.0" />
<httpRuntime maxRequestLength="20480" />
</system.web>
</configuration>
Run Code Online (Sandbox Code Playgroud)
我不再收到错误,但实际上并没有做任何事情.它仍适用于较小的图像.
我在这里使用了这个教程:http://www.asp.net/web-pages/tutorials/files,-images,-and-media/9-working-with-images
我的代码如下:
@{ WebImage photo = null;
var newFileName = "";
var imagePath = "";
var imageThumbPath = "";
if(IsPost){
photo = WebImage.GetImageFromRequest();
if(photo != null){
newFileName = "Original_" + Path.GetFileName(photo.FileName);
imagePath = @"images\" + newFileName;
photo.Save(@"~\" + imagePath);
newFileName = "Thumbnail_" + Path.GetFileName(photo.FileName);
imagePath = @"images\" + newFileName;
photo.Resize(width: 60, height: 60, …Run Code Online (Sandbox Code Playgroud) 是否有任何功能可以快速调整Visual C++中的图片大小?我想制作一张原始图片的副本,它会小x倍.然后我想把它放在黑色位图的中心.黑色位图的大小与第一张图片的大小相同.
这是原始图片:https://www.dropbox.com/s/6she1kvcby53qgz/term.bmp
这是我想要收到的效果:https: //www.dropbox.com/s/8ah59z0ip6tq4wd/term2.bmp
在我的程序中,我使用Pylon的库.图像采用CPylonImage类型.
我一直在评估Nathanael Jones 令人惊叹的成像库和插件,用于我公司在Azure上构建的一些图像处理服务.在获得许可证之前,我们会对它们进行全面测试,以确保它们符合我们的方案.帮自己一个忙,在这里检查一下.
在ASP.NET MVC Web应用程序中使用插件时,我在插件方面取得了巨大成功.我正在使用我在UI中发布的Controller中的图像服务器功能.裁剪,调整大小和简单/高级过滤器正在按预期工作.
我遇到的问题是当我将此功能作为该应用程序中的类库移动到WCF服务时.裁剪和调整大小的工作完全符合预期,但所有过滤指令(亮度,对比度,棕褐色等)都被忽略或无声地失败.这是图像处理代码:
var instructions = new ImageResizer.Instructions();
//All of these instructions work
instructions.Width = 300;
instructions.Height = 300;
instructions.Mode = ImageResizer.FitMode.Crop;
instructions.OutputFormat = ImageResizer.OutputFormat.Jpeg;
instructions.JpegQuality = 90;
double[] cropCoordinates = {0,100,0,100};
instructions.CropRectangle = cropCoordinates;
instructions.Mode = ImageResizer.FitMode.Crop;
//These instructions are ignored, or fail silently
instructions.Invert = true;
instructions.Saturation = -1;
instructions.Sepia = true;
var imageJob = new ImageResizer.ImageJob();
imageJob.Instructions = instructions;
imageJob.Source = bmpSource;
imageJob.Dest = typeof(Bitmap);
imageJob.Build();
Run Code Online (Sandbox Code Playgroud)
我已经将我的MVC应用程序使用的Web.Config设置复制到使用ImageResizing包(来自Nuget)的类库的App.Config.
<configuration>
<configSections>
<section …Run Code Online (Sandbox Code Playgroud) 我有一系列滚动水平布局的图像。图像之间有边距。我正在使用 jQuery 脚本,该脚本负责根据浏览器窗口大小调整图像大小。我的问题是,如何调整图像之间的边距?
我需要设计完全流畅,因此媒体查询不是这种情况下的解决方案。
HTML:
<div id="page">
<div id="header">
</div>
<div id="slides">
<div class="slide"><img src="image01.jpg" /></div>
<div class="slide"><img src="image02.jpg" /></div>
<div class="slide"><img src="image03.jpg" /></div>
....
<div class="slide"><img src="imageN.jpg" /></div>
</div>
<div id="footer">
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
#slides {
width: 100%;
white-space: nowrap;
}
.slide {
display: inline-block;
margin-right: 20px;
vertical-align: top;
}
Run Code Online (Sandbox Code Playgroud)
jQuery:
jQuery(document).ready(function($){
var $window = $(window),
$header = $('#header'),
$footer = $('#footer');
var getHorizontalPageHeight = function () {
return $window.height() - $header.outerHeight() - $footer.outerHeight();
};
var $slides = $('#slides'), …Run Code Online (Sandbox Code Playgroud) 相机快速拍摄照片后,我无法调整照片大小。目前,我的场景中有一个 100 x 100 的图像视图(用于个人资料照片),但是当我运行该应用程序时,使用相机后照片永远不会出现。这是我的代码。我缺少什么:
@IBAction func employeePhotoButton(sender: AnyObject) {
if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.Camera) {
var imagePicker = UIImagePickerController()
imagePicker.delegate = self
imagePicker.sourceType = UIImagePickerControllerSourceType.Camera;
imagePicker.allowsEditing = false
self.presentViewController(imagePicker, animated: true, completion: nil)
func resizeImage(image: UIImage, newWidth: CGFloat) -> UIImage {
let scale = newWidth / image.size.width
let newHeight = image.size.height * scale
UIGraphicsBeginImageContext(CGSizeMake(newWidth, newHeight))
image.drawInRect(CGRectMake(0, 0, newWidth, newHeight))
let newImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return newImage
}
func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage!, editingInfo: [NSObject : AnyObject]!) {
employeePhoto.image = resizeImage(image!, newWidth: …Run Code Online (Sandbox Code Playgroud) 我有这个 PHP 脚本,可以将图像大小调整为 50%(或任何预设百分比)
$filename = 'test.jpg';
$percent = 0.5;
// Content type
header('Content-Type: image/jpeg');
// Get new dimensions
list($width, $height) = getimagesize($filename);
$new_width = $width * $percent;
$new_height = $height * $percent;
// Resample
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
// Output
imagejpeg($image_p, null, 100);
Run Code Online (Sandbox Code Playgroud)
现在,如果我想将 $new_width 指定为 1200 (px) 并告诉 $new_height 自动计算保持纵横比并将新图像的名称设置为“test-2.jpg”怎么办
$filename = 'test.jpg';
// Content type
header('Content-Type: image/jpeg');
// Get new dimensions
list($width, $height) = …Run Code Online (Sandbox Code Playgroud) [~] python3
Python 3.6.8 (default, Jan 14 2019, 11:02:34)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np, cv2
>>> a=np.arange(10,250,10).reshape((6,4))
>>> a
array([[ 10, 20, 30, 40],
[ 50, 60, 70, 80],
[ 90, 100, 110, 120],
[130, 140, 150, 160],
[170, 180, 190, 200],
[210, 220, 230, 240]])
>>> cv2.resize(a,(3,2))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
cv2.error: OpenCV(4.1.0) /io/opencv/modules/imgproc/src/resize.cpp:3596: …Run Code Online (Sandbox Code Playgroud) 我正在尝试构建一个使用超分辨率来上采样/升级单个低分辨率图像的应用程序.这种算法称为单图像超分辨率.我正在寻找任何现有的基于C/C++的算法实现,以便快速进行原型设计.如果您遇到过代码,可以帮助我吗?
什么转换器(如 imagemagick)可用于转换图像并保留 exif 数据?
如果我将图像缩小 4 倍会怎样?我还应该改变焦距吗?
我从 JPG 照片中提取的数据exiftool
Focal Length : 50.0 mm (35 mm equivalent: 50.0 mm)
Run Code Online (Sandbox Code Playgroud)
编辑: 似乎 imagemagick 保留 exif 数据:
mogrify -resize 25% -path output_foler/ *.JPG