imaging

Python (PIL): Lighten transparent image and paste to another one

浪尽此生 提交于 2020-01-14 14:22:45
问题 I have two png-images (A & B) of the same size, the second (B) one is partially transparent. If I paste image B into image A using the code base.paste(overlay, mask=overlay) I get a nearly perfect combination of them. But I want to lighten image B before pasting it into image A. I have tried using a mask like Image.new("L", size, 80) and I can lighten image (B) with it, but it also darkens image (A) and that must not modified. On the command line, I can do what I want with ImageMagick like

Python (PIL): Lighten transparent image and paste to another one

六月ゝ 毕业季﹏ 提交于 2020-01-14 14:22:04
问题 I have two png-images (A & B) of the same size, the second (B) one is partially transparent. If I paste image B into image A using the code base.paste(overlay, mask=overlay) I get a nearly perfect combination of them. But I want to lighten image B before pasting it into image A. I have tried using a mask like Image.new("L", size, 80) and I can lighten image (B) with it, but it also darkens image (A) and that must not modified. On the command line, I can do what I want with ImageMagick like

Imagick not reflects the gravity once it is set

喜你入骨 提交于 2020-01-06 07:16:06
问题 I am trying to translate the following piece of Imagemagick command line code convert tmpI.mpc -gravity center -crop ${ww}x${hc}+0+0 +repage as follows $tmpIC->setGravity(imagick::GRAVITY_CENTER); $tmpIC->cropImage($ww, $hc, 0, 0); $tmpIC->setImagePage($tmpIC->getImageWidth(), $tmpIC->getImageHeight(), 0, 0); but setting or not setting the gravity makes no difference. Please tell me what is wrong with the piece of code I have Width and Height of the image before cropping are tmpIC-

Plotting interpolated values using LinearNDInterpolator (Python)

流过昼夜 提交于 2020-01-01 07:37:12
问题 I am using the LinearNDInterpolator on some (x, y, z) data, using the following script. However, I cannot figure out how to go from the interpolated data to plotting/showing the interpolation in heatmap form? Am I missing something like setting up a meshgrid based on the min and max of x and y? Any help or an example would be great! import numpy as np import scipy.interpolate x = np.array([-4386795.73911443, -1239996.25110694, -3974316.43669208, 1560260.49911342, 4977361.53694849, -1996458

Android ImageReader get NV21 format?

笑着哭i 提交于 2020-01-01 04:57:19
问题 I do not have a background in imaging or graphics, so please bear with me :) I am using JavaCV in one of my projects. In the examples, a Frame is constructed which has a buffer of a certain size. When using the public void onPreviewFrame(byte[] data, Camera camera) function in Android, copying this data byte array is no problem if you declare the Frame as new Frame(frameWidth, frameHeight, Frame.DEPTH_UBYTE, 2); where frameWidth and frameHeight are declared as Camera.Size previewSize =

Python imaging alternatives

别说谁变了你拦得住时间么 提交于 2019-12-31 08:39:45
问题 I have python code that needs to do just a couple simple things to photographs: crop, resize, and overlay a watermark. I've used PIL, and the resample/resize results are TERRIBLE. I've used imagemagick, and the interface and commands were designed by packaging a cat in a box, and then repeatedly throwing it down a set of stairs at a keyboard. I'm looking for something which is not PIL or Imagemagick that I can use with python to do simple, high-quality image transformations. For that matter,

Canvas to Save Image and Email

孤街醉人 提交于 2019-12-25 01:47:17
问题 We have a custom product designing tool at "http://dev.ejuicysolutions.com/custom_shirt_designer/". When user will be finished with formatting with text etc... they will click on print button, where they can print but we need to extend functionality from print to "Save Image, as shown in Canvas" and then email that image. Email can be done but the main problem we are facing is that image is being saved on server but all other formatting like text are not being saved along with. Either script

Version of Windows Imaging Component

自闭症网瘾萝莉.ら 提交于 2019-12-24 02:53:26
问题 How can I check what version of Windows Imaging Component is installed on a Windows machine? I suspect the Windows 2008 Servers used in Azure do not have the same version that I have on my Windows 7 development machine. I just want to verify that as I need the latest TIFF codec. 回答1: Will not make a definite statement, but I think that the WIC on the Windows Azure is the same what you have on your Windows 7. Just be aware that there are 2 OS families in Windows Azure. OS Family 1.x is using

Version of Windows Imaging Component

倖福魔咒の 提交于 2019-12-24 02:53:01
问题 How can I check what version of Windows Imaging Component is installed on a Windows machine? I suspect the Windows 2008 Servers used in Azure do not have the same version that I have on my Windows 7 development machine. I just want to verify that as I need the latest TIFF codec. 回答1: Will not make a definite statement, but I think that the WIC on the Windows Azure is the same what you have on your Windows 7. Just be aware that there are 2 OS families in Windows Azure. OS Family 1.x is using

Storage Commitment Service (push model): how i get the result back to my SCU?

半腔热情 提交于 2019-12-22 18:36:19
问题 I planned to implement a Storage Commitment Service to verify if files previously sent to the storage were safely stored. My architecture is very simple and straightforward my SCU sends some secondary capture images to the storage and I want to be sure they are safely stored before delete them. I am going to adopt push model and I wonder what steps/features I need to implement to accomplish the service What I understood is I need to issue a N-ACTION request with SOP Class UID 1.2.840.10008.1