# Column with total pixels - size

**URL:** https://resource.dopus.com/t/column-with-total-pixels-size/28682
**Category:** Help & Support
**Created:** [April 28, 2018, 12:03pm UTC](https://resource.dopus.com/t/column-with-total-pixels-size/28682 "2018-04-28T12:03:07Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![opw62](https://resource.dopus.com/letter_avatar_proxy/v4/letter/o/5e9695/32.png) [@opw62](https://resource.dopus.com/u/opw62)
#### Post date: [April 28, 2018, 12:03pm UTC](https://resource.dopus.com/t/column-with-total-pixels-size/28682/1 "2018-04-28T12:03:07Z")

</div>

For images Opus offers columns with W and H (pixels).  
I would like to filter and delete images below a certain total pixels size.

I can not simply sort on "W" (width pixels) and then delete below a certain width : many images are photos shot as 'portrait' , so they have a smaller width, but the height is okay and v.v. I can not delete photos below a certain height in pixels.

In that case I assume the total number of pixels (i.e. W-pixels x H-pixels) should then be considered.

Have not found any viewer so far offering a kind of 'Total Pixels' column.

Any suggestions?

Thanks.

---

<div class="post-metadata">

### Author: ![Jon](https://resource.dopus.com/user_avatar/resource.dopus.com/jon/32/12713_2.png) [@Jon](https://resource.dopus.com/u/Jon)
#### Post date: [April 28, 2018, 1:01pm UTC](https://resource.dopus.com/t/column-with-total-pixels-size/28682/2 "2018-04-28T13:01:34Z")

</div>

You can use an advanced find to search for both width and height. You can also use the Dimensions column.

---

<div class="post-metadata">

### Author: ![opw62](https://resource.dopus.com/letter_avatar_proxy/v4/letter/o/5e9695/32.png) [@opw62](https://resource.dopus.com/u/opw62)
#### Post date: [April 28, 2018, 2:35pm UTC](https://resource.dopus.com/t/column-with-total-pixels-size/28682/3 "2018-04-28T14:35:14Z")

</div>

With 'Total Pixels' I meant: pixels W multiplied with pixels L.  
AFAIK this column does not exist and neither does it in the number of image viewers I checked.

Something like:

![SnagIt-28042018%20163112](https://resource.dopus.com/uploads/default/original/3X/b/e/be7cd13212247f7a6e1a8f8ccc2556117d076dda.png)

This is probably the only way to delete small sized images (small on screen)

---

<div class="post-metadata">

### Author: ![Jon](https://resource.dopus.com/user_avatar/resource.dopus.com/jon/32/12713_2.png) [@Jon](https://resource.dopus.com/u/Jon)
#### Post date: [April 29, 2018, 7:00am UTC](https://resource.dopus.com/t/column-with-total-pixels-size/28682/6 "2018-04-29T07:00:34Z")

</div>

This script will add a Total Pixels column.

[TotalPixelsColumn.js.txt](https://resource.dopus.com/uploads/default/original/3X/4/8/48acef3c613efcce48daecad2618c79ef40cb685.txt) (1.1 KB)

Script code for those interested:

```javascript
// Called by Directory Opus to initialize the script
function OnInit(initData)
{
	initData.name = "TotalPixelsColumn";
	initData.version = "1.0";
	initData.copyright = "(c) 2018 jpott";
//	initData.url = "https://resource.dopus.com/viewforum.php?f=35";
	initData.desc = "Adds a Total Pixels column";
	initData.default_enable = true;
	initData.min_version = "12.0";

	var col = initData.AddColumn();
	col.name = "TotalPixels";
	col.method = "OnTotalPixels";
	col.label = "TotalPixels";
	col.justify = "right";
	col.autogroup = true;
	col.type = "number";
}

// Implement the TotalPixels column
function OnTotalPixels(scriptColData)
{
	if (scriptColData.item.metadata == "image")
	{
		var imageMeta = scriptColData.item.metadata.image;
		if (imageMeta.picwidth > 0 && imageMeta.picheight > 0)
			scriptColData.value = imageMeta.picwidth * imageMeta.picheight;
	}
}

```

---

<div class="post-metadata">

### Author: ![opw62](https://resource.dopus.com/letter_avatar_proxy/v4/letter/o/5e9695/32.png) [@opw62](https://resource.dopus.com/u/opw62)
#### Post date: [April 30, 2018, 6:12am UTC](https://resource.dopus.com/t/column-with-total-pixels-size/28682/7 "2018-04-30T06:12:54Z")

</div>

Magnificent!

**Many** thanks indeed! This is exactly what I have been looking for.

From various image sources on Internet I have downloaded many, I mean many, images from my hometown in the old days. A lot of them are simply too small and are useless.  
In my case and on my monitor, the threshold is somewhere around 280-300.000 on 'Total pixels'. All below that, I can simply delete.  
At first I gave 'Dimensions' a try, but discovered that the sorting is somewhat different from total pixels.

Anyway, again, many thanks!  
This definitely saves me a lot hassle.
